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
_______________________________________________
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Reply via email to