Migrate Apple DART to implement iova_to_phys_length, passing through
mapped_length from io-pgtable.

Signed-off-by: Guanghui Feng <[email protected]>
---
 drivers/iommu/apple-dart.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index 17bdadb6b504..fdc533ba72da 100644
--- a/drivers/iommu/apple-dart.c
+++ b/drivers/iommu/apple-dart.c
@@ -528,16 +528,17 @@ static int apple_dart_iotlb_sync_map(struct iommu_domain 
*domain,
        return 0;
 }
 
-static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain,
-                                          dma_addr_t iova)
+static phys_addr_t apple_dart_iova_to_phys_length(struct iommu_domain *domain,
+                                          dma_addr_t iova, size_t 
*mapped_length)
 {
        struct apple_dart_domain *dart_domain = to_dart_domain(domain);
        struct io_pgtable_ops *ops = dart_domain->pgtbl_ops;
 
+
        if (!ops)
-               return 0;
+               return PHYS_ADDR_MAX;
 
-       return ops->iova_to_phys(ops, iova);
+       return ops->iova_to_phys_length(ops, iova, mapped_length);
 }
 
 static int apple_dart_map_pages(struct iommu_domain *domain, unsigned long 
iova,
@@ -1018,7 +1019,7 @@ static const struct iommu_ops apple_dart_iommu_ops = {
                .flush_iotlb_all = apple_dart_flush_iotlb_all,
                .iotlb_sync     = apple_dart_iotlb_sync,
                .iotlb_sync_map = apple_dart_iotlb_sync_map,
-               .iova_to_phys   = apple_dart_iova_to_phys,
+               .iova_to_phys_length = apple_dart_iova_to_phys_length,
                .free           = apple_dart_domain_free,
        }
 };
-- 
2.43.7

Reply via email to