[PATCH v2 09/30] iommu/apple-dart: implement iova_to_phys_length
From: Guanghui Feng
Date: Tue Jun 02 2026 - 06:54:18 EST
Migrate Apple DART to implement iova_to_phys_length, passing through
mapped_length from io-pgtable.
Signed-off-by: Guanghui Feng <guanghuifeng@xxxxxxxxxxxxxxxxx>
---
drivers/iommu/apple-dart.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
index 17bdadb6b504..2d753ce96cd9 100644
--- a/drivers/iommu/apple-dart.c
+++ b/drivers/iommu/apple-dart.c
@@ -528,16 +528,19 @@ 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 (mapped_length)
+ *mapped_length = 0;
+
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 +1021,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