aboutsummaryrefslogtreecommitdiffstats
path: root/lib/iommu-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/iommu-common.c')
-rw-r--r--lib/iommu-common.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/iommu-common.c b/lib/iommu-common.c
index ff19f66d3f7f..b1c93e94ca7a 100644
--- a/lib/iommu-common.c
+++ b/lib/iommu-common.c
@@ -21,8 +21,7 @@ static DEFINE_PER_CPU(unsigned int, iommu_hash_common);
21 21
22static inline bool need_flush(struct iommu_map_table *iommu) 22static inline bool need_flush(struct iommu_map_table *iommu)
23{ 23{
24 return (iommu->lazy_flush != NULL && 24 return ((iommu->flags & IOMMU_NEED_FLUSH) != 0);
25 (iommu->flags & IOMMU_NEED_FLUSH) != 0);
26} 25}
27 26
28static inline void set_flush(struct iommu_map_table *iommu) 27static inline void set_flush(struct iommu_map_table *iommu)
@@ -211,7 +210,8 @@ unsigned long iommu_tbl_range_alloc(struct device *dev,
211 goto bail; 210 goto bail;
212 } 211 }
213 } 212 }
214 if (n < pool->hint || need_flush(iommu)) { 213 if (iommu->lazy_flush &&
214 (n < pool->hint || need_flush(iommu))) {
215 clear_flush(iommu); 215 clear_flush(iommu);
216 iommu->lazy_flush(iommu); 216 iommu->lazy_flush(iommu);
217 } 217 }