Migrate ARM SMMUv3 to implement iova_to_phys_length, calling ops->iova_to_phys_length on the io-pgtable layer. Signed-off-by: Guanghui Feng --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c index e8d7dbe495f0..69fb7ce74681 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c @@ -4069,14 +4069,18 @@ static void arm_smmu_iotlb_sync(struct iommu_domain *domain, } static phys_addr_t -arm_smmu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova) +arm_smmu_iova_to_phys_length(struct iommu_domain *domain, dma_addr_t iova, + size_t *mapped_length) { struct io_pgtable_ops *ops = to_smmu_domain(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 struct platform_driver arm_smmu_driver; @@ -4396,7 +4400,7 @@ static const struct iommu_ops arm_smmu_ops = { .unmap_pages = arm_smmu_unmap_pages, .flush_iotlb_all = arm_smmu_flush_iotlb_all, .iotlb_sync = arm_smmu_iotlb_sync, - .iova_to_phys = arm_smmu_iova_to_phys, + .iova_to_phys_length = arm_smmu_iova_to_phys_length, .free = arm_smmu_domain_free_paging, } }; -- 2.43.7