From d62673feadb92c9af43ea06d4ef52b29948f585e Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Tue, 7 Jun 2016 14:55:50 -0700 Subject: iommu: Add DOMAIN_ATTR_PAGE_TABLE_IS_COHERENT Add a read-only domain attribute for querying whether or not the page table of an IOMMU is coherent. Change-Id: Ifa70b155348ef3d111a41fcad47eccb00d68d427 Signed-off-by: Mitchel Humpherys --- include/linux/iommu.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/iommu.h b/include/linux/iommu.h index d7db6b2eeb52..005e83752c68 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -134,6 +134,7 @@ enum iommu_attr { DOMAIN_ATTR_FAST, DOMAIN_ATTR_PGTBL_INFO, DOMAIN_ATTR_EARLY_MAP, + DOMAIN_ATTR_PAGE_TABLE_IS_COHERENT, DOMAIN_ATTR_MAX, }; -- cgit v1.2.3 From 31d36a8989d1084f16b5a54fa4aa2b14eaff13d9 Mon Sep 17 00:00:00 2001 From: Mitchel Humpherys Date: Tue, 7 Jun 2016 11:09:44 -0700 Subject: iommu: dma-mapping-fast: Only flush non-coherent page tables Some SMMUs can walk page tables in the CPU cache, avoiding the need to do cache maintenance operations on the page table memory. Don't do cache maintenance on SMMUs with coherent page tables. Change-Id: I47e00e72548212209b59c13a0d7d59cb0ab964ff Signed-off-by: Mitchel Humpherys --- include/linux/dma-mapping-fast.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/dma-mapping-fast.h b/include/linux/dma-mapping-fast.h index ddd126c0fd85..560f04736c1d 100644 --- a/include/linux/dma-mapping-fast.h +++ b/include/linux/dma-mapping-fast.h @@ -36,6 +36,8 @@ struct dma_fast_smmu_mapping { spinlock_t lock; struct notifier_block notifier; + + int is_smmu_pt_coherent; }; #ifdef CONFIG_IOMMU_IO_PGTABLE_FAST -- cgit v1.2.3