Skip to content

Commit 8bd1945

Browse files
committed
iommu/sunxi: define protection flag IOMMU_SUNXI_NO_ZAP_TLB
1 parent 4acf05d commit 8bd1945

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

drivers/iommu/iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2009,7 +2009,7 @@ size_t iommu_map_sg(struct iommu_domain *domain, unsigned long iova,
20092009
#ifdef CONFIG_ARCH_SUNXI
20102010
struct iommu_iotlb_gather iotlb_gather;
20112011

2012-
prot |= (1 << 16);
2012+
prot |= IOMMU_SUNXI_NO_ZAP_TLB;
20132013
#endif
20142014
while (i <= nents) {
20152015
phys_addr_t s_phys = sg_phys(sg);

drivers/iommu/sunxi-iommu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static int sunxi_iommu_map(struct iommu_domain *domain, unsigned long iova,
502502
dma_sync_single_for_device(dma_dev, virt_to_phys(iopte_offset(dent, s_iova_start)),
503503
flush_count << 2, DMA_TO_DEVICE);
504504
out:
505-
if (!(prot & (1 << 16)))
505+
if (!(prot & IOMMU_SUNXI_NO_ZAP_TLB))
506506
sunxi_zap_tlb(iova, size);
507507
mutex_unlock(&sunxi_domain->dt_lock);
508508

include/linux/iommu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@
3636
* last level cache, aka system cache.
3737
*/
3838
#define IOMMU_QCOM_SYS_CACHE (1 << 6)
39+
#ifdef CONFIG_ARCH_SUNXI
40+
/*
41+
* Do not call sunxi_zap_tlb on map if this flag is set.
42+
*/
43+
#define IOMMU_SUNXI_NO_ZAP_TLB (1 << 16)
44+
#endif
3945

4046
struct iommu_ops;
4147
struct iommu_group;

0 commit comments

Comments
 (0)