From patchwork Thu Feb 18 14:12:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 62182 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp610659lbl; Thu, 18 Feb 2016 06:13:39 -0800 (PST) X-Received: by 10.67.24.104 with SMTP id ih8mr10420853pad.124.1455804809667; Thu, 18 Feb 2016 06:13:29 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f63si9683783pfj.137.2016.02.18.06.13.29; Thu, 18 Feb 2016 06:13:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756807AbcBRON2 (ORCPT + 4 others); Thu, 18 Feb 2016 09:13:28 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:60492 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756713AbcBRON0 (ORCPT ); Thu, 18 Feb 2016 09:13:26 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O2Q00MIVY6C0WA0@mailout2.w1.samsung.com> for linux-samsung-soc@vger.kernel.org; Thu, 18 Feb 2016 14:13:24 +0000 (GMT) X-AuditID: cbfec7f5-f79b16d000005389-5d-56c5d184fae8 Received: from eusync4.samsung.com ( [203.254.199.214]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 31.20.21385.481D5C65; Thu, 18 Feb 2016 14:13:24 +0000 (GMT) Received: from amdc1339.digital.local ([106.116.147.30]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O2Q00576Y5X95B0@eusync4.samsung.com>; Thu, 18 Feb 2016 14:13:24 +0000 (GMT) From: Marek Szyprowski To: iommu@lists.linux-foundation.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Marek Szyprowski , Joerg Roedel , Inki Dae , Kukjin Kim , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz Subject: [PATCH v2 08/13] iommu: exynos: unify code for fldp cache invalidation Date: Thu, 18 Feb 2016 15:12:55 +0100 Message-id: <1455804780-9616-9-git-send-email-m.szyprowski@samsung.com> X-Mailer: git-send-email 1.9.2 In-reply-to: <1455804780-9616-1-git-send-email-m.szyprowski@samsung.com> References: <1455804780-9616-1-git-send-email-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrILMWRmVeSWpSXmKPExsVy+t/xa7otF4+GGZzdKmOxccZ6VotJ9yew WCzYb23ROXsDu8XrF4YW/Y9fM1tsenyN1WLG+X1MFmuP3GV34PR4cnAek8emVZ1sHpuX1HtM vrGc0aNvyypGj8+b5ALYorhsUlJzMstSi/TtErgyevZPZyx4xFWx5Hs7SwNjL2cXIyeHhICJ xJ/dl9ghbDGJC/fWs3UxcnEICSxllNj2bjsrhNPEJHHu1TNmkCo2AUOJrrddbCC2iEC+xIu9 f1lAipgFfjFKnOtsZwJJCAv4S2zb0cQCYrMIqErc/AaxglfAXeLIhuOMEOvkJP6/XAFWzyng IbH51AawuBBQzZ+HM5kmMPIuYGRYxSiaWppcUJyUnmukV5yYW1yal66XnJ+7iREScF93MC49 ZnWIUYCDUYmHd8OLI2FCrIllxZW5hxglOJiVRHh37z0aJsSbklhZlVqUH19UmpNafIhRmoNF SZx35q73IUIC6YklqdmpqQWpRTBZJg5OqQbGiVafJGMTzvr8/GfIvZrH8uiisBKxP+df2KcF a1YlB3Xzq7OkWymeuilUbqjYU5y2qm1zzuGzC42D76aU/PfZ1uGjK59+/42hzkI/j6YrrLyX Xp9Oa1Nvjpj7O/fT3oddVf0XL5grCMzzWG1usSZW8Oq1Wyw3r+utdRPqydgdxJ03cbtNfrYS S3FGoqEWc1FxIgA30E9bNAIAAA== Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch simplifies the code for handling of flpdcache invalidation. Signed-off-by: Marek Szyprowski --- drivers/iommu/exynos-iommu.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) -- 1.9.2 -- To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c index 15787a177a16..e42a76cc9674 100644 --- a/drivers/iommu/exynos-iommu.c +++ b/drivers/iommu/exynos-iommu.c @@ -440,13 +440,6 @@ static int __sysmmu_enable(struct sysmmu_drvdata *data, phys_addr_t pgtable, return ret; } -static void __sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, - sysmmu_iova_t iova) -{ - if (data->version == MAKE_MMU_VER(3, 3)) - __raw_writel(iova | 0x1, data->sfrbase + REG_MMU_FLUSH_ENTRY); -} - static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, sysmmu_iova_t iova) { @@ -455,8 +448,10 @@ static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data, clk_enable(data->clk_master); spin_lock_irqsave(&data->lock, flags); - if (is_sysmmu_active(data)) - __sysmmu_tlb_invalidate_flpdcache(data, iova); + if (is_sysmmu_active(data)) { + if (data->version >= MAKE_MMU_VER(3, 3)) + __sysmmu_tlb_invalidate_entry(data, iova, 1); + } spin_unlock_irqrestore(&data->lock, flags); clk_disable(data->clk_master);