summaryrefslogtreecommitdiffstats
path: root/drivers/iommu/mtk_iommu.h
diff options
context:
space:
mode:
authorRobin Murphy2017-07-06 18:55:30 +0200
committerWill Deacon2017-07-20 11:30:27 +0200
commit98a8f63e56a0bdcf1d0af8d840d011ab90386684 (patch)
treead2d756e8769b73d814d93cc818ce5f8598e0169 /drivers/iommu/mtk_iommu.h
parentiommu/arm-smmu: Reintroduce locking around TLB sync operations (diff)
downloadkernel-qcow2-linux-98a8f63e56a0bdcf1d0af8d840d011ab90386684.tar.gz
kernel-qcow2-linux-98a8f63e56a0bdcf1d0af8d840d011ab90386684.tar.xz
kernel-qcow2-linux-98a8f63e56a0bdcf1d0af8d840d011ab90386684.zip
iommu/mtk: Avoid redundant TLB syncs locally
Under certain circumstances, the io-pgtable code may end up issuing two TLB sync operations without any intervening invalidations. This goes badly for the M4U hardware, since it means the second sync ends up polling for a non-existent operation to finish, and as a result times out and warns. The io_pgtable_tlb_* helpers implement a high-level optimisation to avoid issuing the second sync at all in such cases, but in order to work correctly that requires all pagetable operations to be serialised under a lock, thus is no longer applicable to all io-pgtable users. Since we're the only user actually relying on this flag for correctness, let's reimplement it locally to avoid the headache of trying to make the high-level version concurrency-safe for other users. CC: Yong Wu <yong.wu@mediatek.com> CC: Matthias Brugger <matthias.bgg@gmail.com> Tested-by: Yong Wu <yong.wu@mediatek.com> Signed-off-by: Robin Murphy <robin.murphy@arm.com> Signed-off-by: Will Deacon <will.deacon@arm.com>
Diffstat (limited to 'drivers/iommu/mtk_iommu.h')
-rw-r--r--drivers/iommu/mtk_iommu.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/mtk_iommu.h b/drivers/iommu/mtk_iommu.h
index 2a28eadeea0e..c06cc91b5d9a 100644
--- a/drivers/iommu/mtk_iommu.h
+++ b/drivers/iommu/mtk_iommu.h
@@ -47,6 +47,7 @@ struct mtk_iommu_data {
struct iommu_group *m4u_group;
struct mtk_smi_iommu smi_imu; /* SMI larb iommu info */
bool enable_4GB;
+ bool tlb_flush_active;
struct iommu_device iommu;
};