From e58bc4b97a025442deadc135fc815aacb6678fe4 Mon Sep 17 00:00:00 2001 From: Chris Goldsworthy Date: Thu, 27 Aug 2020 20:55:13 -0700 Subject: [PATCH] iommu: msm: enable lazy mapping for waipio Enable the "lazy mapping" feature, which lets dma_bufs be unmapped lazily when the DMA_ATTR_DELAYED_UNMAP attribute is used for a buffer. Change-Id: I28771db8449f78cfc89eaac0b67db914f055dba6 Signed-off-by: Chris Goldsworthy --- drivers/iommu/Kconfig | 12 ++++++++++++ drivers/iommu/Makefile | 1 + modules.list.msm.lahaina | 1 + modules.list.msm.waipio | 1 + 4 files changed, 15 insertions(+) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 16898dec587f..a11a86f09673 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -442,6 +442,18 @@ config ARM_SMMU_V3 Say Y here if your system includes an IOMMU device implementing the ARM SMMUv3 architecture. +config QCOM_LAZY_MAPPING + tristate "Reference counted iommu-mapping support" + depends on ION + depends on IOMMU_API + help + ION buffers may be shared between several software clients. + Reference counting the mapping may simplify coordination between + these clients, and decrease latency by preventing multiple + map/unmaps of the same region. + + If unsure, say N here. + config S390_IOMMU def_bool y if S390 && PCI depends on S390 && PCI diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index 342190196dfb..ff7d622c5eb1 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -4,6 +4,7 @@ obj-$(CONFIG_IOMMU_API) += iommu-traces.o obj-$(CONFIG_IOMMU_API) += iommu-sysfs.o obj-$(CONFIG_IOMMU_DEBUGFS) += iommu-debugfs.o obj-$(CONFIG_IOMMU_DMA) += dma-iommu.o +obj-$(CONFIG_QCOM_LAZY_MAPPING) += msm_dma_iommu_mapping.o obj-$(CONFIG_IOMMU_IO_PGTABLE) += io-pgtable.o obj-$(CONFIG_IOMMU_IO_PGTABLE_ARMV7S) += io-pgtable-arm-v7s.o obj-$(CONFIG_IOMMU_IO_PGTABLE_LPAE) += io-pgtable-arm.o diff --git a/modules.list.msm.lahaina b/modules.list.msm.lahaina index 9bf1b3811bc4..d4202bf50c38 100755 --- a/modules.list.msm.lahaina +++ b/modules.list.msm.lahaina @@ -24,6 +24,7 @@ qcom-pdc.ko iommu-logger.ko arm_smmu.ko msm_ion_heaps.ko +msm_dma_iommu_mapping.ko qcom-arm-smmu-mod.ko #phy-qcom-ufs.ko #phy-qcom-ufs-qmp-v4-lahaina.ko diff --git a/modules.list.msm.waipio b/modules.list.msm.waipio index 493cee4ae47a..eef3beec6bbf 100644 --- a/modules.list.msm.waipio +++ b/modules.list.msm.waipio @@ -24,3 +24,4 @@ usb_f_mass_storage.ko msm-geni-se.ko msm_geni_serial.ko msm_ion_heaps.ko +msm_dma_iommu_mapping.ko