MSI_IOVA* macros are common among different iommu/smu drivers, so move them to common iommu.h header file. This doesn't change anything wrt functionality of the IOMMU subsystem. Suggested-by: Jacob Pan <jacob.pan@xxxxxxxxxxxxxxxxxxx> Signed-off-by: Shyam Saini <shyamsaini@xxxxxxxxxxxxxxxxxxx> --- drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h | 3 --- drivers/iommu/arm/arm-smmu/arm-smmu.c | 3 --- drivers/iommu/virtio-iommu.c | 2 -- include/linux/iommu.h | 3 +++ 4 files changed, 3 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h index bd9d7c85576a2..d1713f6bbe6d1 100644 --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.h @@ -502,9 +502,6 @@ static inline unsigned int arm_smmu_cdtab_l2_idx(unsigned int ssid) #define ARM_SMMU_POLL_TIMEOUT_US 1000000 /* 1s! */ #define ARM_SMMU_POLL_SPIN_COUNT 10 -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 - enum pri_resp { PRI_RESP_DENY = 0, PRI_RESP_FAIL = 1, diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c index 79afc92e1d8b9..287f8e8d25890 100644 --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c @@ -49,9 +49,6 @@ */ #define QCOM_DUMMY_VAL -1 -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 - static int force_stage; module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index b85ce6310ddbd..8c8783c8b31be 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -24,8 +24,6 @@ #include "dma-iommu.h" -#define MSI_IOVA_BASE 0x8000000 -#define MSI_IOVA_LENGTH 0x100000 #define VIOMMU_REQUEST_VQ 0 #define VIOMMU_EVENT_VQ 1 diff --git a/include/linux/iommu.h b/include/linux/iommu.h index 38c65e92ecd09..2a26d3e18b24e 100644 --- a/include/linux/iommu.h +++ b/include/linux/iommu.h @@ -1505,6 +1505,9 @@ static inline void iommu_debugfs_setup(void) {} #ifdef CONFIG_IOMMU_DMA #include <linux/msi.h> +#define MSI_IOVA_BASE 0x8000000 +#define MSI_IOVA_LENGTH 0x100000 + int iommu_get_msi_cookie(struct iommu_domain *domain, dma_addr_t base); int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr); -- 2.34.1