From 2981d63a6bdd6ada531612cb54cdee698cceb2b9 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 19 Nov 2019 11:45:06 -0800 Subject: [PATCH 1/4] iommu/arm-smmu: Remove legacy bindings bus initialization initcall No currently supported targets utilize the deprecated mmu-masters bindings, which results in the legacy bindings initcall being a no-op. Thus, remove the initcall to the legacy bindings routine for now, until this can be handled properly. Change-Id: Ie8b1004914315e757c059f8b8fc2b8713351be16 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm-smmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index aafac8dd63e3..bafc1b37036e 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -4763,13 +4763,12 @@ out_exit_power_resources: * delay setting bus ops until we're sure every possible SMMU is ready, * and that way ensure that no add_device() calls get missed. */ -static int arm_smmu_legacy_bus_init(void) +static int __maybe_unused arm_smmu_legacy_bus_init(void) { if (using_legacy_binding) arm_smmu_bus_init(); return 0; } -device_initcall_sync(arm_smmu_legacy_bus_init); static int arm_smmu_device_remove(struct platform_device *pdev) { From 871061b2ea31c5f71738117f4322580586d0e326 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 19 Nov 2019 11:50:30 -0800 Subject: [PATCH 2/4] Revert "iommu/arm-smmu: Make arm-smmu explicitly non-modular" This reverts commit addb672f200f4e99368270da205320b83efe01a0. Change-Id: I2e9dc3c90c7821fc378afee3cb83bfce66c9d14c Signed-off-by: Isaac J. Manjarres --- drivers/iommu/arm-smmu.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/iommu/arm-smmu.c b/drivers/iommu/arm-smmu.c index bafc1b37036e..88998694e00f 100644 --- a/drivers/iommu/arm-smmu.c +++ b/drivers/iommu/arm-smmu.c @@ -80,10 +80,6 @@ #define ARM_SMMU_ICC_PEAK_BW_LOW 0 static int force_stage; -/* - * not really modular, but the easiest way to keep compat with existing - * bootargs behaviour is to continue using module_param() here. - */ module_param(force_stage, int, S_IRUGO); MODULE_PARM_DESC(force_stage, "Force SMMU mappings to be installed at a particular stage of translation. A value of '1' or '2' forces the corresponding stage. All other values are ignored (i.e. no stage is forced). Note that selecting a specific stage will disable support for nested translation."); @@ -5529,3 +5525,5 @@ static struct platform_driver qsmmuv500_tbu_driver = { }, .probe = qsmmuv500_tbu_probe, }; + +MODULE_LICENSE("GPL v2"); From 207d91c187a1d980c3a295514f5403e711a58919 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 19 Nov 2019 11:54:38 -0800 Subject: [PATCH 3/4] iommu/arm-smmu: Allow the ARM-SMMU driver to be a module Allow the ARM SMMU driver to be compiled as a loadable kernel module. Change-Id: Ib982ddb7f8ed82c5f7983db8b85bb2c6c83502c6 Signed-off-by: Isaac J. Manjarres --- drivers/iommu/Kconfig | 2 +- drivers/iommu/Makefile | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/iommu/Kconfig b/drivers/iommu/Kconfig index 7c5fdf384ca8..d7508858dda3 100644 --- a/drivers/iommu/Kconfig +++ b/drivers/iommu/Kconfig @@ -401,7 +401,7 @@ config SPAPR_TCE_IOMMU # ARM IOMMU support config ARM_SMMU - bool "ARM Ltd. System MMU (SMMU) Support" + tristate "ARM Ltd. System MMU (SMMU) Support" depends on (ARM64 || ARM) && MMU select IOMMU_API select IOMMU_IO_PGTABLE_LPAE diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile index 6980e4ae4515..b356598dc95c 100644 --- a/drivers/iommu/Makefile +++ b/drivers/iommu/Makefile @@ -16,7 +16,8 @@ obj-$(CONFIG_MSM_IOMMU) += msm_iommu.o obj-$(CONFIG_AMD_IOMMU) += amd_iommu.o amd_iommu_init.o amd_iommu_quirks.o obj-$(CONFIG_AMD_IOMMU_DEBUGFS) += amd_iommu_debugfs.o obj-$(CONFIG_AMD_IOMMU_V2) += amd_iommu_v2.o -obj-$(CONFIG_ARM_SMMU) += arm-smmu.o arm-smmu-impl.o +obj-$(CONFIG_ARM_SMMU) += arm-smmu-mod.o +arm-smmu-mod-objs += arm-smmu.o arm-smmu-impl.o obj-$(CONFIG_ARM_SMMU_V3) += arm-smmu-v3.o obj-$(CONFIG_DMAR_TABLE) += dmar.o obj-$(CONFIG_INTEL_IOMMU) += intel-iommu.o intel-pasid.o From 3f411d46fb12ff1de0527d0b9b7f16f29bcd1df5 Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 19 Nov 2019 11:57:09 -0800 Subject: [PATCH 4/4] arm64: defconfig: Enable the ARM SMMU module on Lahaina Enable the ARM SMMU driver as a module for Lahaina GKI. Change-Id: I217b0fc81c78331fc2a710546eaa1d3e79a59917 Signed-off-by: Isaac J. Manjarres --- arch/arm64/configs/vendor/lahaina_GKI.config | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/vendor/lahaina_GKI.config b/arch/arm64/configs/vendor/lahaina_GKI.config index ed1259af0966..98021bb9fb20 100644 --- a/arch/arm64/configs/vendor/lahaina_GKI.config +++ b/arch/arm64/configs/vendor/lahaina_GKI.config @@ -57,3 +57,4 @@ CONFIG_USB_MSM_SSPHY_QMP=m CONFIG_MSM_HSUSB_PHY=m CONFIG_MSM_CAMCC_LAHAINA=m CONFIG_MSM_BT_POWER=m +CONFIG_ARM_SMMU=m