diff mbox series

[for,4.9,18/39] iommu/exynos: Block SYSMMU while invalidating FLPD cache

Message ID 20170918004024.7247-1-alexander.levin@verizon.com
State New
Headers show
Series None | expand

Commit Message

Levin, Alexander (Sasha Levin) Sept. 18, 2017, 12:40 a.m. UTC
From: Marek Szyprowski <m.szyprowski@samsung.com>


[ Upstream commit 7d2aa6b814476a2e2794960f844344519246df72 ]

Documentation specifies that SYSMMU should be in blocked state while
performing TLB/FLPD cache invalidation, so add needed calls to
sysmmu_block/unblock.

Fixes: 66a7ed84b345d ("iommu/exynos: Apply workaround of caching fault page table entries")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>

Signed-off-by: Joerg Roedel <jroedel@suse.de>

Signed-off-by: Sasha Levin <alexander.levin@verizon.com>

---
 drivers/iommu/exynos-iommu.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

-- 
2.11.0
diff mbox series

Patch

diff --git a/drivers/iommu/exynos-iommu.c b/drivers/iommu/exynos-iommu.c
index 30808e91b775..c7820b3ea80e 100644
--- a/drivers/iommu/exynos-iommu.c
+++ b/drivers/iommu/exynos-iommu.c
@@ -542,7 +542,10 @@  static void sysmmu_tlb_invalidate_flpdcache(struct sysmmu_drvdata *data,
 	spin_lock_irqsave(&data->lock, flags);
 	if (is_sysmmu_active(data) && data->version >= MAKE_MMU_VER(3, 3)) {
 		clk_enable(data->clk_master);
-		__sysmmu_tlb_invalidate_entry(data, iova, 1);
+		if (sysmmu_block(data)) {
+			__sysmmu_tlb_invalidate_entry(data, iova, 1);
+			sysmmu_unblock(data);
+		}
 		clk_disable(data->clk_master);
 	}
 	spin_unlock_irqrestore(&data->lock, flags);