iommu/io-pgtable-arm: Convert to IOMMU API TLB sync
[platform/kernel/linux-rpi.git] / drivers / iommu / arm-smmu-v3.c
index e67ba6c..ee0c7b7 100644 (file)
@@ -1743,6 +1743,14 @@ arm_smmu_unmap(struct iommu_domain *domain, unsigned long iova, size_t size)
        return ops->unmap(ops, iova, size);
 }
 
+static void arm_smmu_iotlb_sync(struct iommu_domain *domain)
+{
+       struct arm_smmu_device *smmu = to_smmu_domain(domain)->smmu;
+
+       if (smmu)
+               __arm_smmu_tlb_sync(smmu);
+}
+
 static phys_addr_t
 arm_smmu_iova_to_phys(struct iommu_domain *domain, dma_addr_t iova)
 {
@@ -1963,6 +1971,8 @@ static struct iommu_ops arm_smmu_ops = {
        .map                    = arm_smmu_map,
        .unmap                  = arm_smmu_unmap,
        .map_sg                 = default_iommu_map_sg,
+       .flush_iotlb_all        = arm_smmu_iotlb_sync,
+       .iotlb_sync             = arm_smmu_iotlb_sync,
        .iova_to_phys           = arm_smmu_iova_to_phys,
        .add_device             = arm_smmu_add_device,
        .remove_device          = arm_smmu_remove_device,