]> git.baikalelectronics.ru Git - kernel.git/commit
iommu/mtk: Avoid redundant TLB syncs locally
authorRobin Murphy <robin.murphy@arm.com>
Thu, 6 Jul 2017 16:55:30 +0000 (17:55 +0100)
committerWill Deacon <will.deacon@arm.com>
Thu, 20 Jul 2017 09:30:27 +0000 (10:30 +0100)
commit33a2ad80b1becbc37ae69b77b750a79271223b5e
treead2d756e8769b73d814d93cc818ce5f8598e0169
parentd9f64a87a884b9d76a9263ceb85751185b9e421a
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>
drivers/iommu/mtk_iommu.c
drivers/iommu/mtk_iommu.h