aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/mach-msm/iommu.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/arch/arm/mach-msm/iommu.c b/arch/arm/mach-msm/iommu.c
index 134add789187..74f2157eba4e 100644
--- a/arch/arm/mach-msm/iommu.c
+++ b/arch/arm/mach-msm/iommu.c
@@ -50,13 +50,16 @@ static void __flush_iotlb(struct iommu_domain *domain)
50 unsigned long *fl_table = priv->pgtable; 50 unsigned long *fl_table = priv->pgtable;
51 int i; 51 int i;
52 52
53 dmac_flush_range(fl_table, fl_table + SZ_16K); 53 if (!list_empty(&priv->list_attached)) {
54 dmac_flush_range(fl_table, fl_table + SZ_16K);
54 55
55 for (i = 0; i < NUM_FL_PTE; i++) 56 for (i = 0; i < NUM_FL_PTE; i++)
56 if ((fl_table[i] & 0x03) == FL_TYPE_TABLE) { 57 if ((fl_table[i] & 0x03) == FL_TYPE_TABLE) {
57 void *sl_table = __va(fl_table[i] & FL_BASE_MASK); 58 void *sl_table = __va(fl_table[i] &
58 dmac_flush_range(sl_table, sl_table + SZ_4K); 59 FL_BASE_MASK);
59 } 60 dmac_flush_range(sl_table, sl_table + SZ_4K);
61 }
62 }
60#endif 63#endif
61 64
62 list_for_each_entry(ctx_drvdata, &priv->list_attached, attached_elm) { 65 list_for_each_entry(ctx_drvdata, &priv->list_attached, attached_elm) {