Migrate Qualcomm IOMMU to implement iova_to_phys_length, calling
ops->iova_to_phys_length on the io-pgtable layer.

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

diff --git a/drivers/iommu/arm/arm-smmu/qcom_iommu.c 
b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
index a1e8cf29f594..9e0e8b5caec1 100644
--- a/drivers/iommu/arm/arm-smmu/qcom_iommu.c
+++ b/drivers/iommu/arm/arm-smmu/qcom_iommu.c
@@ -489,19 +489,20 @@ static void qcom_iommu_iotlb_sync(struct iommu_domain 
*domain,
        qcom_iommu_flush_iotlb_all(domain);
 }
 
-static phys_addr_t qcom_iommu_iova_to_phys(struct iommu_domain *domain,
-                                          dma_addr_t iova)
+static phys_addr_t qcom_iommu_iova_to_phys_length(struct iommu_domain *domain,
+                                          dma_addr_t iova, size_t 
*mapped_length)
 {
        phys_addr_t ret;
        unsigned long flags;
        struct qcom_iommu_domain *qcom_domain = to_qcom_iommu_domain(domain);
        struct io_pgtable_ops *ops = qcom_domain->pgtbl_ops;
 
+
        if (!ops)
-               return 0;
+               return PHYS_ADDR_MAX;
 
        spin_lock_irqsave(&qcom_domain->pgtbl_lock, flags);
-       ret = ops->iova_to_phys(ops, iova);
+       ret = ops->iova_to_phys_length(ops, iova, mapped_length);
        spin_unlock_irqrestore(&qcom_domain->pgtbl_lock, flags);
 
        return ret;
@@ -602,7 +603,7 @@ static const struct iommu_ops qcom_iommu_ops = {
                .unmap_pages    = qcom_iommu_unmap,
                .flush_iotlb_all = qcom_iommu_flush_iotlb_all,
                .iotlb_sync     = qcom_iommu_iotlb_sync,
-               .iova_to_phys   = qcom_iommu_iova_to_phys,
+               .iova_to_phys_length = qcom_iommu_iova_to_phys_length,
                .free           = qcom_iommu_domain_free,
        }
 };
-- 
2.43.7

Reply via email to