* [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix
@ 2020-02-18 17:27 Will Deacon
2020-02-18 17:40 ` Robin Murphy
0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2020-02-18 17:27 UTC (permalink / raw)
To: joro
Cc: kernel-team, Robin Murphy, Russell King, iommu, Li Yang,
Will Deacon, linux-arm-kernel
Extending the Arm SMMU driver to allow for modular builds changed
KBUILD_MODNAME to be "arm_smmu_mod" so that a single module could be
built from the multiple existing object files without the need to rename
any source files.
This inadvertently changed the name of the driver parameters, which may
lead to runtime issues if bootloaders are relying on the old names for
correctness (e.g. "arm-smmu.disable_bypass=0").
Although MODULE_PARAM_PREFIX can be overridden to restore the old naming
for builtin parameters, only the new name is matched by modprobe and so
loading the driver as a module would cause parameters specified on the
kernel command line to be ignored. Instead, rename "arm_smmu_mod" to
"arm_smmu". Whilst it's a bit of a bodge, this allows us to create a
single module without renaming any files and makes use of the fact that
underscores and hyphens can be used interchangeably in parameter names.
Cc: Robin Murphy <robin.murphy@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Reported-by: Li Yang <leoyang.li@nxp.com>
Fixes: cd221bd24ff5 ("iommu/arm-smmu: Allow building as a module")
Signed-off-by: Will Deacon <will@kernel.org>
---
drivers/iommu/Makefile | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
index 2104fb8afc06..9f33fdb3bb05 100644
--- a/drivers/iommu/Makefile
+++ b/drivers/iommu/Makefile
@@ -14,8 +14,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-mod.o
-arm-smmu-mod-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.o
+obj-$(CONFIG_ARM_SMMU) += arm_smmu.o
+arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.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
--
2.25.0.265.gbab2e86ba0-goog
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix
2020-02-18 17:27 [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix Will Deacon
@ 2020-02-18 17:40 ` Robin Murphy
2020-02-19 11:00 ` Will Deacon
0 siblings, 1 reply; 4+ messages in thread
From: Robin Murphy @ 2020-02-18 17:40 UTC (permalink / raw)
To: Will Deacon, joro
Cc: iommu, kernel-team, Russell King, linux-arm-kernel, Li Yang
On 18/02/2020 5:27 pm, Will Deacon wrote:
> Extending the Arm SMMU driver to allow for modular builds changed
> KBUILD_MODNAME to be "arm_smmu_mod" so that a single module could be
> built from the multiple existing object files without the need to rename
> any source files.
>
> This inadvertently changed the name of the driver parameters, which may
> lead to runtime issues if bootloaders are relying on the old names for
> correctness (e.g. "arm-smmu.disable_bypass=0").
Indeed, it turns out this also tripped up some Juno setups in our
internal CI that were bodging around firmware issues.
> Although MODULE_PARAM_PREFIX can be overridden to restore the old naming
> for builtin parameters, only the new name is matched by modprobe and so
> loading the driver as a module would cause parameters specified on the
> kernel command line to be ignored. Instead, rename "arm_smmu_mod" to
> "arm_smmu". Whilst it's a bit of a bodge, this allows us to create a
> single module without renaming any files and makes use of the fact that
> underscores and hyphens can be used interchangeably in parameter names.
That's awful... and thus great :)
Reviewed-by: Robin Murphy <robin.murphy@arm.com>
> Cc: Robin Murphy <robin.murphy@arm.com>
> Cc: Russell King <linux@armlinux.org.uk>
> Reported-by: Li Yang <leoyang.li@nxp.com>
> Fixes: cd221bd24ff5 ("iommu/arm-smmu: Allow building as a module")
> Signed-off-by: Will Deacon <will@kernel.org>
> ---
> drivers/iommu/Makefile | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/Makefile b/drivers/iommu/Makefile
> index 2104fb8afc06..9f33fdb3bb05 100644
> --- a/drivers/iommu/Makefile
> +++ b/drivers/iommu/Makefile
> @@ -14,8 +14,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-mod.o
> -arm-smmu-mod-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.o
> +obj-$(CONFIG_ARM_SMMU) += arm_smmu.o
> +arm_smmu-objs += arm-smmu.o arm-smmu-impl.o arm-smmu-qcom.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
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix
2020-02-18 17:40 ` Robin Murphy
@ 2020-02-19 11:00 ` Will Deacon
2020-02-19 11:03 ` Joerg Roedel
0 siblings, 1 reply; 4+ messages in thread
From: Will Deacon @ 2020-02-19 11:00 UTC (permalink / raw)
To: Robin Murphy
Cc: joro, Russell King, Li Yang, iommu, kernel-team, linux-arm-kernel
On Tue, Feb 18, 2020 at 05:40:39PM +0000, Robin Murphy wrote:
> On 18/02/2020 5:27 pm, Will Deacon wrote:
> > Extending the Arm SMMU driver to allow for modular builds changed
> > KBUILD_MODNAME to be "arm_smmu_mod" so that a single module could be
> > built from the multiple existing object files without the need to rename
> > any source files.
> >
> > This inadvertently changed the name of the driver parameters, which may
> > lead to runtime issues if bootloaders are relying on the old names for
> > correctness (e.g. "arm-smmu.disable_bypass=0").
>
> Indeed, it turns out this also tripped up some Juno setups in our internal
> CI that were bodging around firmware issues.
>
> > Although MODULE_PARAM_PREFIX can be overridden to restore the old naming
> > for builtin parameters, only the new name is matched by modprobe and so
> > loading the driver as a module would cause parameters specified on the
> > kernel command line to be ignored. Instead, rename "arm_smmu_mod" to
> > "arm_smmu". Whilst it's a bit of a bodge, this allows us to create a
> > single module without renaming any files and makes use of the fact that
> > underscores and hyphens can be used interchangeably in parameter names.
>
> That's awful... and thus great :)
>
> Reviewed-by: Robin Murphy <robin.murphy@arm.com>
Cheers, Robin!
Joerg -- please can you pick this up as a fix for 5.6? I don't have any
other SMMU fixes queued, so it doesn't seem worth sending a pull request
to you just for this.
Thanks,
Will
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix
2020-02-19 11:00 ` Will Deacon
@ 2020-02-19 11:03 ` Joerg Roedel
0 siblings, 0 replies; 4+ messages in thread
From: Joerg Roedel @ 2020-02-19 11:03 UTC (permalink / raw)
To: Will Deacon
Cc: Robin Murphy, Russell King, Li Yang, iommu, kernel-team,
linux-arm-kernel
On Wed, Feb 19, 2020 at 11:00:46AM +0000, Will Deacon wrote:
> Joerg -- please can you pick this up as a fix for 5.6? I don't have any
> other SMMU fixes queued, so it doesn't seem worth sending a pull request
> to you just for this.
Applied, thanks.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-02-19 11:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 17:27 [PATCH] iommu/arm-smmu: Restore naming of driver parameter prefix Will Deacon
2020-02-18 17:40 ` Robin Murphy
2020-02-19 11:00 ` Will Deacon
2020-02-19 11:03 ` Joerg Roedel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).