Skip to contentSkip to conversation

perf/smmuv3: Add MODULE_ALIAS for module auto loading

PATCH Applied Yicong Yang 3 participants 3 messages Aug 14, 2023 – Aug 15, 2023 Arm PMU profiling and debugging

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf/smmuv3: Add MODULE_ALIAS for module auto loading

From: Yicong Yang <[email protected]>

On my ACPI based arm64 server, if the SMMUv3 PMU is configured as module it won't be loaded automatically after booting even if the device has already been scanned and added. It's because the module lacks a platform alias, the uevent mechanism and userspace tools like udevd make use of this to find the target driver module of the device. This patch adds the missing platform alias of the module, then module will be loaded automatically if device exists.

Before this patch:
[root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias

alias:          of:N*T*Carm,smmu-v3-pmcgC*
alias:          of:N*T*Carm,smmu-v3-pmcg

After this patch:
[root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias

alias:          platform:arm-smmu-v3-pmcg
alias:          of:N*T*Carm,smmu-v3-pmcgC*
alias:          of:N*T*Carm,smmu-v3-pmcg

---
Change since v1:
- Further illustrate the issues and how to fix this
- Use MODULE_ALIAS instead of MODULE_DEVICE_TABLE

 drivers/perf/arm_smmuv3_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/arm_smmuv3_pmu.c +1 -0
index 25a269d431e4..4c32b6dbfe76 100644
@@ -984,6 +984,7 @@ static void __exit arm_smmu_pmu_exit(void)
 
 module_exit(arm_smmu_pmu_exit);
 
+MODULE_ALIAS("platform:arm-smmu-v3-pmcg");
 MODULE_DESCRIPTION("PMU driver for ARM SMMUv3 Performance Monitors Extension");
 MODULE_AUTHOR("Neil Leeder <[email protected]>");
 MODULE_AUTHOR("Shameer Kolothum <[email protected]>");
Signature · 7 lines
2.24.0


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw
Quoted 45 lines · Yicong Yang

From: Yicong Yang <[email protected]>

On my ACPI based arm64 server, if the SMMUv3 PMU is configured as module it won't be loaded automatically after booting even if the device has already been scanned and added. It's because the module lacks a platform alias, the uevent mechanism and userspace tools like udevd make use of this to find the target driver module of the device. This patch adds the missing platform alias of the module, then module will be loaded automatically if device exists.

Before this patch:
[root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias

alias:          of:N*T*Carm,smmu-v3-pmcgC*
alias:          of:N*T*Carm,smmu-v3-pmcg

After this patch:
[root@localhost tmp]# modinfo arm_smmuv3_pmu | grep alias

alias:          platform:arm-smmu-v3-pmcg
alias:          of:N*T*Carm,smmu-v3-pmcgC*
alias:          of:N*T*Carm,smmu-v3-pmcg

---
Change since v1:
- Further illustrate the issues and how to fix this
- Use MODULE_ALIAS instead of MODULE_DEVICE_TABLE

 drivers/perf/arm_smmuv3_pmu.c | 1 +
 1 file changed, 1 insertion(+)
drivers/perf/arm_smmuv3_pmu.c +1 -0
index 25a269d431e4..4c32b6dbfe76 100644
@@ -984,6 +984,7 @@ static void __exit arm_smmu_pmu_exit(void)
 
 module_exit(arm_smmu_pmu_exit);
 
+MODULE_ALIAS("platform:arm-smmu-v3-pmcg");
 MODULE_DESCRIPTION("PMU driver for ARM SMMUv3 Performance Monitors Extension");
 MODULE_AUTHOR("Neil Leeder <[email protected]>");
 MODULE_AUTHOR("Shameer Kolothum <[email protected]>");
Signature · 1 line
2.24.0

Looks good to me. :) Thanks.

Regards.
Liang Li

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

maintainer Applied
#2 lore raw
In reply to Yicong Yang
Quoted 11 lines · Yicong Yang

From: Yicong Yang <[email protected]>

On my ACPI based arm64 server, if the SMMUv3 PMU is configured as module it won't be loaded automatically after booting even if the device has already been scanned and added. It's because the module lacks a platform alias, the uevent mechanism and userspace tools like udevd make use of this to find the target driver module of the device. This patch adds the missing platform alias of the module, then module will be loaded automatically if device exists.

[...]

Applied to will (for-next/perf), thanks!

[1/1] perf/smmuv3: Add MODULE_ALIAS for module auto loading

      https://git.kernel.org/will/c/1b0e3ea9301a

Cheers,

Signature · 10 lines
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel