From patchwork Thu Aug 17 12:56:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 9906269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id C3699603B5 for ; Thu, 17 Aug 2017 12:59:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8EAD2866B for ; Thu, 17 Aug 2017 12:59:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D857287B2; Thu, 17 Aug 2017 12:59:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E04F28745 for ; Thu, 17 Aug 2017 12:59:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=EgNSzbWFWDTrdYV/k5eiITPAVf4qXw0dgLvgb6DqliY=; b=ctm1E8Yu6VUgmCcu4512AS9qRR de4VUgCE376UeV24aqvdKDPfqc89z3af9LtAEQjY9bi2DrIf7H8l/NPLK5XHQHEBHZq21cHTzGVNU STP8NimLVkooEf+88/oPv6ZeE+Ij5deqa+9WLDZqyXTx3Y8pNAu7mlvG17ezQXI+2x6GPFFatTB7o LoKr1eHNjIsL/nc4wtJ9NWiAf+N9bm5UNXRRaiuhdZ6IYKrDlx+nKdzry1iGue3pzVlbHNj0Oe4uJ 1Dte6gLeWWkrBZyqV+1pdKcSmG8grF3B7AqmBwU8KraozmQEZ1C7FVjPrQAWBV+iLvJvQpfvhPd4/ vxl21rNQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1diKNX-0000Be-35; Thu, 17 Aug 2017 12:58:27 +0000 Received: from 8bytes.org ([2a01:238:4383:600:38bc:a715:4b6d:a889] helo=theia.8bytes.org) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1diKMW-0008M7-T9; Thu, 17 Aug 2017 12:57:30 +0000 Received: by theia.8bytes.org (Postfix, from userid 1000) id 2FBAC218; Thu, 17 Aug 2017 14:56:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1502974615; bh=PQPjlD3Xy0u7bYlRzRUipkjfhH1Q7weQ0LuVEiCt7Ko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mx3hZ2vLUBUsvEx+BmChh5pFdAutEKSp0m7ZuV3mk5hsYm4eRDJi0+Nru0vnNDjQw VdNsdRVVZqUu2l6WI6/R3AOQ4YT9bpGH91BzUvodWzfj5W3v6F7UPqlgwCH2vWZGNg ew9r58CqHrCYpDXS3d4o8xSMLvg+nOnwlsU7lg6+Dbb60sd2GP6q36aJ2XDRwd5m8K XYnU8WQkGg6pSonDi/PaG1OooTJZTRSOuQIF602TXcGntk7dPvoUIMRWY4Z7OX0pNa AmYHGBz4eqbSQImcl+NivGSRJ3iamBv4g0HdbMtLW1jaZ1gELTEpRp/zNzivSJ1uDp ky/VIQt0Es+qQ== From: Joerg Roedel To: iommu@lists.linux-foundation.org Subject: [PATCH 09/13] drm/rockchip: Use sychronized interface of the IOMMU-API Date: Thu, 17 Aug 2017 14:56:32 +0200 Message-Id: <1502974596-23835-10-git-send-email-joro@8bytes.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502974596-23835-1-git-send-email-joro@8bytes.org> References: <1502974596-23835-1-git-send-email-joro@8bytes.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170817_055728_243892_6F18D61C X-CRM114-Status: UNSURE ( 9.25 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Joerg Roedel , Heiko Stuebner , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Suravee Suthikulpanit , linux-arm-kernel@lists.infradead.org, Mark Yao MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Joerg Roedel The map and unmap functions of the IOMMU-API changed their semantics: They do no longer guarantee that the hardware TLBs are synchronized with the page-table updates they made. To make conversion easier, new synchronized functions have been introduced which give these guarantees again until the code is converted to use the new TLB-flush interface of the IOMMU-API, which allows certain optimizations. But for now, just convert this code to use the synchronized functions so that it will behave as before. Cc: Mark Yao Cc: David Airlie Cc: Heiko Stuebner Cc: dri-devel@lists.freedesktop.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-rockchip@lists.infradead.org Signed-off-by: Joerg Roedel --- drivers/gpu/drm/rockchip/rockchip_drm_gem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c index b74ac71..6d28224 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_gem.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_gem.c @@ -41,8 +41,8 @@ static int rockchip_gem_iommu_map(struct rockchip_gem_object *rk_obj) rk_obj->dma_addr = rk_obj->mm.start; - ret = iommu_map_sg(private->domain, rk_obj->dma_addr, rk_obj->sgt->sgl, - rk_obj->sgt->nents, prot); + ret = iommu_map_sg_sync(private->domain, rk_obj->dma_addr, + rk_obj->sgt->sgl, rk_obj->sgt->nents, prot); if (ret < rk_obj->base.size) { DRM_ERROR("failed to map buffer: size=%zd request_size=%zd\n", ret, rk_obj->base.size); @@ -67,7 +67,7 @@ static int rockchip_gem_iommu_unmap(struct rockchip_gem_object *rk_obj) struct drm_device *drm = rk_obj->base.dev; struct rockchip_drm_private *private = drm->dev_private; - iommu_unmap(private->domain, rk_obj->dma_addr, rk_obj->size); + iommu_unmap_sync(private->domain, rk_obj->dma_addr, rk_obj->size); mutex_lock(&private->mm_lock);