From patchwork Thu Aug 17 12:56:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 9906295 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 4A8EC60386 for ; Thu, 17 Aug 2017 13:03:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 312A428AEA for ; Thu, 17 Aug 2017 13:03:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2635F28AFF; Thu, 17 Aug 2017 13:03:55 +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 DBC7128AEA for ; Thu, 17 Aug 2017 13:03:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4CF8E6E5BF; Thu, 17 Aug 2017 13:03:49 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 408 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 65E726E5AF; Thu, 17 Aug 2017 13:03:46 +0000 (UTC) Received: by theia.8bytes.org (Postfix, from userid 1000) id 0372422B; Thu, 17 Aug 2017 14:56:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=8bytes.org; s=mail-1; t=1502974615; bh=NSNq24aaXzxukwTsIWOb9GE4tublupqjZTeYbjafcWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XAaP0Jml4LsfsxRnzNVtw8CM7KiNoe2j7bx3SpwNFX6YS84COOPmDthTGXEHpedUm J14nwDEOx76zaMY8CgfIbl2xX2GZeJDacm9qekwRdEhN3HCkdqQp2Kou7x4jm/DJpE 2SkqSlysiKtsSVNsWLsUN8hjxAnqiP4ZV+qhqZbR0yC8fcLh1rCcfPgv1Kn2GM5IVa HdqETPjfgxmHSPkJWCZZ7rH92STuHZ6m2eQDbKCRYwFr8taCGHUyJf+mAlgJ2jRmfA /Wmpwf3cXeVuS/p5oAjkiF3GKmPnmC9ni3HN3kMSjRforhWhlJKxZc1353zcTn6+AV AvISso/Q55FRg== From: Joerg Roedel To: iommu@lists.linux-foundation.org Subject: [PATCH 07/13] drm/msm: Use sychronized interface of the IOMMU-API Date: Thu, 17 Aug 2017 14:56:30 +0200 Message-Id: <1502974596-23835-8-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-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Suravee Suthikulpanit , freedreno@lists.freedesktop.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: Rob Clark Cc: David Airlie Cc: linux-arm-msm@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org Signed-off-by: Joerg Roedel Acked-by: Rob Clark --- drivers/gpu/drm/msm/msm_iommu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/msm/msm_iommu.c b/drivers/gpu/drm/msm/msm_iommu.c index b23d336..b3525b7 100644 --- a/drivers/gpu/drm/msm/msm_iommu.c +++ b/drivers/gpu/drm/msm/msm_iommu.c @@ -64,7 +64,8 @@ static int msm_iommu_map(struct msm_mmu *mmu, uint64_t iova, size_t ret; // pm_runtime_get_sync(mmu->dev); - ret = iommu_map_sg(iommu->domain, iova, sgt->sgl, sgt->nents, prot); + ret = iommu_map_sg_sync(iommu->domain, iova, sgt->sgl, + sgt->nents, prot); // pm_runtime_put_sync(mmu->dev); WARN_ON(ret < 0); @@ -77,7 +78,7 @@ static int msm_iommu_unmap(struct msm_mmu *mmu, uint64_t iova, struct msm_iommu *iommu = to_msm_iommu(mmu); pm_runtime_get_sync(mmu->dev); - iommu_unmap(iommu->domain, iova, len); + iommu_unmap_sync(iommu->domain, iova, len); pm_runtime_put_sync(mmu->dev); return 0;