Add device tree support to the CMDQV driver to enable usage on Tegra264
SoCs. The implementation parses the nvidia,cmdqv phandle from the SMMU
device tree node to associate each SMMU with its corresponding CMDQV
instance based on compatible string.
Remove the dependency from Kconfig as the driver now supports both ACPI
and device tree initialization through conditional compilation and
ARM_SMMU_V3 depends on ARM64 which implies at least OF.
Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
---
drivers/iommu/arm/Kconfig | 1 -
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 32 ++++++++++++++
.../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 43 ++++++++++++++++++-
3 files changed, 74 insertions(+), 2 deletions(-)
diff --git a/drivers/iommu/arm/Kconfig b/drivers/iommu/arm/Kconfig
index ef42bbe07dbe..5fac08b89dee 100644
--- a/drivers/iommu/arm/Kconfig
+++ b/drivers/iommu/arm/Kconfig
@@ -121,7 +121,6 @@ config ARM_SMMU_V3_KUNIT_TEST
config TEGRA241_CMDQV
bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
- depends on ACPI
help
Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
index a33fbd12a0dd..206dffabc9c0 100644
--- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
+++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
@@ -4530,6 +4530,35 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
return 0;
}
+#ifdef CONFIG_TEGRA241_CMDQV
+static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
+ struct arm_smmu_device *smmu)
+{
+ struct platform_device *pdev;
+ struct device_node *np;
+
+ np = of_parse_phandle(smmu_node, "nvidia,cmdqv", 0);
+ if (!np)
+ return;
+
+ pdev = of_find_device_by_node(np);
+ of_node_put(np);
+ if (!pdev)
+ return;
+
+ smmu->impl_dev = &pdev->dev;
+ smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
+ dev_info(smmu->dev, "found companion CMDQV device: %s\n",
+ dev_name(smmu->impl_dev));
+ put_device(&pdev->dev);
+}
+#else
+static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
+ struct arm_smmu_device *smmu)
+{
+}
+#endif
+
#ifdef CONFIG_ACPI
#ifdef CONFIG_TEGRA241_CMDQV
static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node,
@@ -4634,6 +4663,9 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev,
if (of_dma_is_coherent(dev->of_node))
smmu->features |= ARM_SMMU_FEAT_COHERENCY;
+ if (of_device_is_compatible(dev->of_node, "nvidia,tegra264-smmu"))
+ tegra_cmdqv_dt_probe(dev->of_node, smmu);
+
return ret;
}
diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
index 378104cd395e..2608bf6518b4 100644
--- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
+++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
@@ -11,6 +11,8 @@
#include <linux/iommufd.h>
#include <linux/iopoll.h>
#include <uapi/linux/iommufd.h>
+#include <linux/of_platform.h>
+#include <linux/platform_device.h>
#include <acpi/acpixf.h>
@@ -917,6 +919,26 @@ tegra241_cmdqv_find_acpi_resource(struct device *dev, int *irq)
return res;
}
+static struct resource *
+tegra241_cmdqv_find_dt_resource(struct device *dev, int *irq)
+{
+ struct platform_device *pdev = to_platform_device(dev);
+ struct resource *res;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ if (!res) {
+ dev_err(dev, "no memory resource found for CMDQV\n");
+ return NULL;
+ }
+
+ if (irq)
+ *irq = platform_get_irq_optional(pdev, 0);
+ if (!irq || *irq <= 0)
+ dev_warn(dev, "no interrupt. errors will not be reported\n");
+
+ return res;
+}
+
static int tegra241_cmdqv_init_structures(struct arm_smmu_device *smmu)
{
struct tegra241_cmdqv *cmdqv =
@@ -1048,11 +1070,14 @@ struct arm_smmu_device *tegra241_cmdqv_probe(struct arm_smmu_device *smmu)
if (!smmu->dev->of_node)
res = tegra241_cmdqv_find_acpi_resource(smmu->impl_dev, &irq);
+ else
+ res = tegra241_cmdqv_find_dt_resource(smmu->impl_dev, &irq);
if (!res)
goto out_fallback;
new_smmu = __tegra241_cmdqv_probe(smmu, res, irq);
- kfree(res);
+ if (!smmu->dev->of_node)
+ kfree(res);
if (new_smmu)
return new_smmu;
@@ -1346,4 +1371,20 @@ tegra241_cmdqv_init_vintf_user(struct arm_vsmmu *vsmmu,
return ret;
}
+static const struct of_device_id tegra241_cmdqv_of_match[] = {
+ { .compatible = "nvidia,tegra264-cmdqv" },
+ { /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(of, tegra241_cmdqv_of_match);
+
+static struct platform_driver tegra241_cmdqv_driver = {
+ .driver = {
+ .name = "tegra241-cmdqv",
+ .of_match_table = tegra241_cmdqv_of_match,
+ },
+};
+module_platform_driver(tegra241_cmdqv_driver);
+
+MODULE_DESCRIPTION("NVIDIA Tegra241 Command Queue Virtualization Driver");
+MODULE_LICENSE("GPL");
MODULE_IMPORT_NS("IOMMUFD");
--
2.25.1
On 01/12/2025 16:32, Ashish Mhetre wrote:
> Add device tree support to the CMDQV driver to enable usage on Tegra264
> SoCs. The implementation parses the nvidia,cmdqv phandle from the SMMU
> device tree node to associate each SMMU with its corresponding CMDQV
> instance based on compatible string.
>
> Remove the dependency from Kconfig as the driver now supports both ACPI
> and device tree initialization through conditional compilation and
> ARM_SMMU_V3 depends on ARM64 which implies at least OF.
>
> Reviewed-by: Nicolin Chen <nicolinc@nvidia.com>
> Signed-off-by: Ashish Mhetre <amhetre@nvidia.com>
> ---
> drivers/iommu/arm/Kconfig | 1 -
> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 32 ++++++++++++++
> .../iommu/arm/arm-smmu-v3/tegra241-cmdqv.c | 43 ++++++++++++++++++-
> 3 files changed, 74 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/iommu/arm/Kconfig b/drivers/iommu/arm/Kconfig
> index ef42bbe07dbe..5fac08b89dee 100644
> --- a/drivers/iommu/arm/Kconfig
> +++ b/drivers/iommu/arm/Kconfig
> @@ -121,7 +121,6 @@ config ARM_SMMU_V3_KUNIT_TEST
>
> config TEGRA241_CMDQV
> bool "NVIDIA Tegra241 CMDQ-V extension support for ARM SMMUv3"
> - depends on ACPI
> help
> Support for NVIDIA CMDQ-Virtualization extension for ARM SMMUv3. The
> CMDQ-V extension is similar to v3.3 ECMDQ for multi command queues
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index a33fbd12a0dd..206dffabc9c0 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -4530,6 +4530,35 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
> return 0;
> }
>
> +#ifdef CONFIG_TEGRA241_CMDQV
> +static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
> + struct arm_smmu_device *smmu)
> +{
> + struct platform_device *pdev;
> + struct device_node *np;
> +
> + np = of_parse_phandle(smmu_node, "nvidia,cmdqv", 0);
> + if (!np)
> + return;
> +
> + pdev = of_find_device_by_node(np);
> + of_node_put(np);
> + if (!pdev)
> + return;
> +
> + smmu->impl_dev = &pdev->dev;
> + smmu->options |= ARM_SMMU_OPT_TEGRA241_CMDQV;
> + dev_info(smmu->dev, "found companion CMDQV device: %s\n",
> + dev_name(smmu->impl_dev));
> + put_device(&pdev->dev);
> +}
> +#else
> +static void tegra_cmdqv_dt_probe(struct device_node *smmu_node,
> + struct arm_smmu_device *smmu)
> +{
> +}
> +#endif
> +
> #ifdef CONFIG_ACPI
> #ifdef CONFIG_TEGRA241_CMDQV
> static void acpi_smmu_dsdt_probe_tegra241_cmdqv(struct acpi_iort_node *node,
> @@ -4634,6 +4663,9 @@ static int arm_smmu_device_dt_probe(struct platform_device *pdev,
> if (of_dma_is_coherent(dev->of_node))
> smmu->features |= ARM_SMMU_FEAT_COHERENCY;
>
> + if (of_device_is_compatible(dev->of_node, "nvidia,tegra264-smmu"))
> + tegra_cmdqv_dt_probe(dev->of_node, smmu);
> +
> return ret;
> }
>
> diff --git a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
> index 378104cd395e..2608bf6518b4 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.c
> @@ -11,6 +11,8 @@
> #include <linux/iommufd.h>
> #include <linux/iopoll.h>
> #include <uapi/linux/iommufd.h>
> +#include <linux/of_platform.h>
> +#include <linux/platform_device.h>
>
> #include <acpi/acpixf.h>
>
> @@ -917,6 +919,26 @@ tegra241_cmdqv_find_acpi_resource(struct device *dev, int *irq)
> return res;
> }
>
> +static struct resource *
> +tegra241_cmdqv_find_dt_resource(struct device *dev, int *irq)
> +{
> + struct platform_device *pdev = to_platform_device(dev);
> + struct resource *res;
> +
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res) {
> + dev_err(dev, "no memory resource found for CMDQV\n");
> + return NULL;
> + }
> +
> + if (irq)
> + *irq = platform_get_irq_optional(pdev, 0);
> + if (!irq || *irq <= 0)
> + dev_warn(dev, "no interrupt. errors will not be reported\n");
> +
> + return res;
> +}
> +
> static int tegra241_cmdqv_init_structures(struct arm_smmu_device *smmu)
> {
> struct tegra241_cmdqv *cmdqv =
> @@ -1048,11 +1070,14 @@ struct arm_smmu_device *tegra241_cmdqv_probe(struct arm_smmu_device *smmu)
>
> if (!smmu->dev->of_node)
> res = tegra241_cmdqv_find_acpi_resource(smmu->impl_dev, &irq);
> + else
> + res = tegra241_cmdqv_find_dt_resource(smmu->impl_dev, &irq);
> if (!res)
> goto out_fallback;
>
> new_smmu = __tegra241_cmdqv_probe(smmu, res, irq);
> - kfree(res);
> + if (!smmu->dev->of_node)
> + kfree(res);
>
> if (new_smmu)
> return new_smmu;
> @@ -1346,4 +1371,20 @@ tegra241_cmdqv_init_vintf_user(struct arm_vsmmu *vsmmu,
> return ret;
> }
>
> +static const struct of_device_id tegra241_cmdqv_of_match[] = {
> + { .compatible = "nvidia,tegra264-cmdqv" },
> + { /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(of, tegra241_cmdqv_of_match);
> +
> +static struct platform_driver tegra241_cmdqv_driver = {
> + .driver = {
> + .name = "tegra241-cmdqv",
> + .of_match_table = tegra241_cmdqv_of_match,
> + },
> +};
> +module_platform_driver(tegra241_cmdqv_driver);
This part looks a bit weird, because it appears to do nothing. The
compatible string is not used at all in the driver AFAICT. Have you
tried this bit out because this is not a proper driver?
Jon
--
nvpublic
Hi Ashish, kernel test robot noticed the following build errors: [auto build test ERROR on next-20251201] [also build test ERROR on v6.18] [cannot apply to robh/for-next linus/master v6.18 v6.18-rc7 v6.18-rc6] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/iommu-arm-smmu-v3-Add-device-tree-support-for-CMDQV-driver/20251202-003517 base: next-20251201 patch link: https://lore.kernel.org/r/20251201163219.3237266-2-amhetre%40nvidia.com patch subject: [PATCH V3 1/3] iommu/arm-smmu-v3: Add device-tree support for CMDQV driver config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20251203/202512031601.IpliwbHW-lkp@intel.com/config) compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251203/202512031601.IpliwbHW-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202512031601.IpliwbHW-lkp@intel.com/ All errors (new ones prefixed by >>): >> ld.lld: error: duplicate symbol: init_module >>> defined at arm-smmu-v3.c >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o:(init_module) >>> defined at tegra241-cmdqv.c >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o:(.init.text+0x4) -- >> ld.lld: error: duplicate symbol: cleanup_module >>> defined at arm-smmu-v3.c >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o:(cleanup_module) >>> defined at tegra241-cmdqv.c >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o:(.exit.text+0x4) -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
On 12/3/2025 2:05 PM, kernel test robot wrote: > External email: Use caution opening links or attachments > > > Hi Ashish, > > kernel test robot noticed the following build errors: > > [auto build test ERROR on next-20251201] > [also build test ERROR on v6.18] > [cannot apply to robh/for-next linus/master v6.18 v6.18-rc7 v6.18-rc6] > [If your patch is applied to the wrong git tree, kindly drop us a note. > And when submitting patch, we suggest to use '--base' as documented in > https://git-scm.com/docs/git-format-patch#_base_tree_information] > > url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/iommu-arm-smmu-v3-Add-device-tree-support-for-CMDQV-driver/20251202-003517 > base: next-20251201 > patch link: https://lore.kernel.org/r/20251201163219.3237266-2-amhetre%40nvidia.com > patch subject: [PATCH V3 1/3] iommu/arm-smmu-v3: Add device-tree support for CMDQV driver > config: arm64-allmodconfig (https://download.01.org/0day-ci/archive/20251203/202512031601.IpliwbHW-lkp@intel.com/config) > compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90) > reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251203/202512031601.IpliwbHW-lkp@intel.com/reproduce) > > If you fix the issue in a separate patch/commit (i.e. not just a new version of > the same patch/commit), kindly add following tags > | Reported-by: kernel test robot <lkp@intel.com> > | Closes: https://lore.kernel.org/oe-kbuild-all/202512031601.IpliwbHW-lkp@intel.com/ > > All errors (new ones prefixed by >>): > >>> ld.lld: error: duplicate symbol: init_module > >>> defined at arm-smmu-v3.c > >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o:(init_module) > >>> defined at tegra241-cmdqv.c > >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o:(.init.text+0x4) > -- >>> ld.lld: error: duplicate symbol: cleanup_module > >>> defined at arm-smmu-v3.c > >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o:(cleanup_module) > >>> defined at tegra241-cmdqv.c > >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o:(.exit.text+0x4) Hi Nic, Robin, How do you suggest fixing this? Is it fine to compile tegra241-cmdqv as separate module and export tegra241_cmdqv_probe() to fix this warning? I am using GCC compiler and was not able to reproduce this with W=1 build. Thanks, Ashish Mhetre > -- > 0-DAY CI Kernel Test Service > https://github.com/intel/lkp-tests/wiki
On 2025-12-03 11:04 am, Ashish Mhetre wrote: > > On 12/3/2025 2:05 PM, kernel test robot wrote: >> External email: Use caution opening links or attachments >> >> >> Hi Ashish, >> >> kernel test robot noticed the following build errors: >> >> [auto build test ERROR on next-20251201] >> [also build test ERROR on v6.18] >> [cannot apply to robh/for-next linus/master v6.18 v6.18-rc7 v6.18-rc6] >> [If your patch is applied to the wrong git tree, kindly drop us a note. >> And when submitting patch, we suggest to use '--base' as documented in >> https://git-scm.com/docs/git-format-patch#_base_tree_information] >> >> url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/ >> iommu-arm-smmu-v3-Add-device-tree-support-for-CMDQV- >> driver/20251202-003517 >> base: next-20251201 >> patch link: https://lore.kernel.org/r/20251201163219.3237266-2- >> amhetre%40nvidia.com >> patch subject: [PATCH V3 1/3] iommu/arm-smmu-v3: Add device-tree >> support for CMDQV driver >> config: arm64-allmodconfig (https://download.01.org/0day-ci/ >> archive/20251203/202512031601.IpliwbHW-lkp@intel.com/config) >> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project >> cd708029e0b2869e80abe31ddb175f7c35361f90) >> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/ >> archive/20251203/202512031601.IpliwbHW-lkp@intel.com/reproduce) >> >> If you fix the issue in a separate patch/commit (i.e. not just a new >> version of >> the same patch/commit), kindly add following tags >> | Reported-by: kernel test robot <lkp@intel.com> >> | Closes: https://lore.kernel.org/oe-kbuild-all/202512031601.IpliwbHW- >> lkp@intel.com/ >> >> All errors (new ones prefixed by >>): >> >>>> ld.lld: error: duplicate symbol: init_module >> >>> defined at arm-smmu-v3.c >> >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o: >> (init_module) >> >>> defined at tegra241-cmdqv.c >> >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o: >> (.init.text+0x4) >> -- >>>> ld.lld: error: duplicate symbol: cleanup_module >> >>> defined at arm-smmu-v3.c >> >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o: >> (cleanup_module) >> >>> defined at tegra241-cmdqv.c >> >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o: >> (.exit.text+0x4) > > Hi Nic, Robin, > > How do you suggest fixing this? Is it fine to compile tegra241-cmdqv as > separate module > and export tegra241_cmdqv_probe() to fix this warning? As Jon just pointed out, the issue is using module_platform_driver(), which is unnecessary anyway since this is not a driver; nor is it even a module, it's just some extra code that can be included in the arm_smmu_v3 driver, and will be integral to the arm_smmu_v3.ko module if built as a such. You could sanity-check the compatible of the phandle target in tegra_cmdqv_dt_probe() if you feel like you should do more than just blindly trust the DT, but either way trying to register a dummy platform driver that won't bind to anything is pointless. > I am using GCC compiler and was not able to reproduce this with W=1 build. This will be happening with CONFIG_ARM_SMMU_V3=m. Thanks, Robin. > > Thanks, > Ashish Mhetre > >> -- >> 0-DAY CI Kernel Test Service >> https://github.com/intel/lkp-tests/wiki
On 12/3/2025 9:19 PM, Robin Murphy wrote: > External email: Use caution opening links or attachments > > > On 2025-12-03 11:04 am, Ashish Mhetre wrote: >> >> On 12/3/2025 2:05 PM, kernel test robot wrote: >>> External email: Use caution opening links or attachments >>> >>> >>> Hi Ashish, >>> >>> kernel test robot noticed the following build errors: >>> >>> [auto build test ERROR on next-20251201] >>> [also build test ERROR on v6.18] >>> [cannot apply to robh/for-next linus/master v6.18 v6.18-rc7 v6.18-rc6] >>> [If your patch is applied to the wrong git tree, kindly drop us a note. >>> And when submitting patch, we suggest to use '--base' as documented in >>> https://git-scm.com/docs/git-format-patch#_base_tree_information] >>> >>> url: https://github.com/intel-lab-lkp/linux/commits/Ashish-Mhetre/ >>> iommu-arm-smmu-v3-Add-device-tree-support-for-CMDQV- >>> driver/20251202-003517 >>> base: next-20251201 >>> patch link: https://lore.kernel.org/r/20251201163219.3237266-2- >>> amhetre%40nvidia.com >>> patch subject: [PATCH V3 1/3] iommu/arm-smmu-v3: Add device-tree >>> support for CMDQV driver >>> config: arm64-allmodconfig (https://download.01.org/0day-ci/ >>> archive/20251203/202512031601.IpliwbHW-lkp@intel.com/config) >>> compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project >>> cd708029e0b2869e80abe31ddb175f7c35361f90) >>> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/ >>> archive/20251203/202512031601.IpliwbHW-lkp@intel.com/reproduce) >>> >>> If you fix the issue in a separate patch/commit (i.e. not just a new >>> version of >>> the same patch/commit), kindly add following tags >>> | Reported-by: kernel test robot <lkp@intel.com> >>> | Closes: https://lore.kernel.org/oe-kbuild-all/202512031601.IpliwbHW- >>> lkp@intel.com/ >>> >>> All errors (new ones prefixed by >>): >>> >>>>> ld.lld: error: duplicate symbol: init_module >>> >>> defined at arm-smmu-v3.c >>> >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o: >>> (init_module) >>> >>> defined at tegra241-cmdqv.c >>> >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o: >>> (.init.text+0x4) >>> -- >>>>> ld.lld: error: duplicate symbol: cleanup_module >>> >>> defined at arm-smmu-v3.c >>> >>> drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.o: >>> (cleanup_module) >>> >>> defined at tegra241-cmdqv.c >>> >>> drivers/iommu/arm/arm-smmu-v3/tegra241-cmdqv.o: >>> (.exit.text+0x4) >> >> Hi Nic, Robin, >> >> How do you suggest fixing this? Is it fine to compile tegra241-cmdqv as >> separate module >> and export tegra241_cmdqv_probe() to fix this warning? > > As Jon just pointed out, the issue is using module_platform_driver(), > which is unnecessary anyway since this is not a driver; nor is it even a > module, it's just some extra code that can be included in the > arm_smmu_v3 driver, and will be integral to the arm_smmu_v3.ko module if > built as a such. > > You could sanity-check the compatible of the phandle target in > tegra_cmdqv_dt_probe() if you feel like you should do more than just > blindly trust the DT, but either way trying to register a dummy platform > driver that won't bind to anything is pointless. > Thanks for the pointers Jon, Robin. I agree that this part of code is redundant and can be removed. I will make these changes in next version. >> I am using GCC compiler and was not able to reproduce this with W=1 >> build. > > This will be happening with CONFIG_ARM_SMMU_V3=m. > > Thanks, > Robin. > >> >> Thanks, >> Ashish Mhetre >> >>> -- >>> 0-DAY CI Kernel Test Service >>> https://github.com/intel/lkp-tests/wiki >
© 2016 - 2026 Red Hat, Inc.