Skip to content

MTK_IOMMU: Optimize mapping / unmapping performance

Chao Hao linux-arm-kernel linux-iommu linux-mediatek lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4iommu: Introduce iotlb_sync_range callbackdrivers/iommu/dma-iommu.c drivers/iommu/iommu.c include/linux/iommu.h+18 -00 replies
2/4iommu/mediatek: Add iotlb_sync_range() supportdrivers/iommu/mtk_iommu.c+6 -04 replies
3/4iommu/mediatek: Remove unnecessary tlb syncdrivers/iommu/mtk_iommu.c+4 -240 replies
4/4iommu/mediatek: Adjust iotlb_sync_rangedrivers/iommu/mtk_iommu.c+4 -100 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] MTK_IOMMU: Optimize mapping / unmapping performance

For MTK platforms, mtk_iommu is using iotlb_sync(), tlb_add_range() and tlb_flush_walk/leaf()
to do tlb sync when iommu driver runs iova mapping/unmapping. But if buffer size is large, it maybe consist of many pages(4K/8K/64K/1MB......). So iommu driver maybe run many times tlb sync in mapping for this case and it will degrade performance seriously. In order to resolve the issue, we hope to add iotlb_sync_range() callback in iommu_ops, it can appiont iova and size to do tlb sync. MTK_IOMMU will use iotlb_sync_range() callback when the whole mapping/unmapping is completed and remove iotlb_sync(), tlb_add_range() and tlb_flush_walk/leaf().
So this patchset will replace iotlb_sync(), tlb_add_range() and tlb_flush_walk/leaf() with
iotlb_sync_range() callback.

Chao Hao (4):
iommu: Introduce iotlb_sync_range callback
iommu/mediatek: Add iotlb_sync_range() support
iommu/mediatek: Remove unnecessary tlb sync
iommu/mediatek: Adjust iotlb_sync_range

    drivers/iommu/dma-iommu.c |  9 +++++++++
    drivers/iommu/iommu.c     |  7 +++++++
    drivers/iommu/mtk_iommu.c | 36 ++++++++----------------------------
    include/linux/iommu.h     |  2 ++
    4 files changed, 26 insertions(+), 28 deletions(-)

--
2.18.0