iommu/tegra: smmu: Add flush_ptc_and_tlb_range()
Hiroshi Doyu [Wed, 3 Apr 2013 08:49:20 +0000 (11:49 +0300)]
Add flush_ptc_and_tlb_range() to handle multiple entries at once.

bug 1254010
bug 1226176
bug 999937

Change-Id: Ib1e9e2e7131345bb422787633eb8d1a4c549dda0
Signed-off-by: Hiroshi Doyu <hdoyu@nvidia.com>
Reviewed-on: http://git-master/r/216851
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Krishna Reddy <vdumpa@nvidia.com>

drivers/iommu/tegra-smmu.c

index d37005f..ce8fc25 100644 (file)
@@ -485,6 +485,19 @@ static void flush_ptc_and_tlb(struct smmu_device *smmu,
        smmu_flush_tlb(smmu, as, iova, is_pde);
 }
 
+static void flush_ptc_and_tlb_range(struct smmu_device *smmu,
+                                   struct smmu_as *as, dma_addr_t iova,
+                                   unsigned long *pte, struct page *page,
+                                   size_t count)
+{
+       int i;
+
+       for (i = 0; i < count; i++) {
+               smmu_flush_ptc(smmu, pte + i, page);
+               smmu_flush_tlb(smmu, as, iova + i * PAGE_SIZE, 0);
+       }
+}
+
 static inline void flush_ptc_and_tlb_all(struct smmu_device *smmu,
                                         struct smmu_as *as)
 {