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: 9906299 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 7D33760386 for ; Thu, 17 Aug 2017 13:04:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 613A828B35 for ; Thu, 17 Aug 2017 13:04:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5EB8728B06; Thu, 17 Aug 2017 13:04:05 +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=-3.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SORBS_SPAM,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B8B5028B5C for ; Thu, 17 Aug 2017 13:04:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A69AA6E5C1; Thu, 17 Aug 2017 13:03:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 410 seconds by postgrey-1.35 at gabe; Thu, 17 Aug 2017 13:03:46 UTC Received: from theia.8bytes.org (8bytes.org [81.169.241.247]) by gabe.freedesktop.org (Postfix) with ESMTPS id 681626E5B3 for ; Thu, 17 Aug 2017 13:03:46 +0000 (UTC) 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> Cc: Joerg Roedel , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, Suravee Suthikulpanit , linux-arm-kernel@lists.infradead.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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);