modpost: drop '*_probe' from section check whitelist
PATCH 1/1 modpost: drop '*_probe' from section check whitelist
Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with __devinit and __devexit, which have since been removed.
Commit e1dc1bfe5b27 ("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver.
Turns out that was indeed an incorrect reference which has now been fixed by commit 9b685058ca93 ("irqchip/qcom-irq-combiner: Fix section mismatch").
A recently added clocksource driver also relies on this suffix to suppress another valid warning, and that is being fixed separately. [1]
Note that drivers with valid reasons for suppressing the warnings can use the __ref macros.
---
As mentioned above there are still two drivers relying on the "_probe" pattern to suppress valid warnings so perhaps it's best to hold off on merging this until the corresponding fixes are in mainline (e.g. next cycle or so unless Thomas can fast-track them).
Johan
scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/mod/modpost.c +1 -1
@@ -953,7 +953,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,/* symbols in data sections that may refer to any init/exit sections */ if (match (fromsec,PATTERNS (DATA_SECTIONS )) &&match (tosec,PATTERNS (ALL_INIT_SECTIONS ,ALL_EXIT_SECTIONS )) && -match (fromsym,PATTERNS ("*_ops" ,"*_probe" ,"*_console" ))) +match (fromsym,PATTERNS ("*_ops" ,"*_console" )))return 0 ;/* Check for pattern 3 */
Signature · 1 line
2.49.1
kernel test robot
build botkernel test robot noticed the following build warnings:
Hi Johan,
kernel test robot noticed the following build warnings:
[auto build test WARNING on linus/master]
[also build test WARNING on v6.18-rc2 next-20251020]
[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/Johan-Hovold/modpost-drop-_probe-from-section-check-whitelist/20251020-171732 base: linus/master patch link: https://lore.kernel.org/r/20251020091613.22562-1-johan%40kernel.org patch subject: [PATCH] modpost: drop '*_probe' from section check whitelist
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: i386-buildonly-randconfig-001-20251020 (https://download.01.org/0day-ci/archive/20251020/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251020/[email protected]/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 <[email protected]>
| Closes: https://lore.kernel.org/r/[email protected]/
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> WARNING: modpost: vmlinux: section mismatch in reference: nxp_stm_probe+0x0 (section: .data) -> nxp_stm_timer_probe (section: .init.text)
Signature · 2 lines
0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
Quoted 18 lines · Johan Hovold
Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with
__devinitand__devexit, which have since been removed.Commit
e1dc1bfe5b27("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver.Turns out that was indeed an incorrect reference which has now been fixed by commit
9b685058ca93("irqchip/qcom-irq-combiner: Fix section mismatch").A recently added clocksource driver also relies on this suffix to suppress another valid warning, and that is being fixed separately. [1]
Note that drivers with valid reasons for suppressing the warnings can use the
__refmacros.
Quoted 8 lines
Signed-off-by Johan Hovold <[email protected]>---
As mentioned above there are still two drivers relying on the "
_probe" pattern to suppress valid warnings so perhaps it's best to hold off on merging this until the corresponding fixes are in mainline (e.g. next cycle or so unless Thomas can fast-track them).
Yeah, if it were fast tracked as a fix for 6.18, we could either use that tag as the base for kbuild-next (as we have not take any patches for 6.19 yet) or if they are 6.19 material, Thomas could provide us with a signed tag or stable shared branch so that we could take this for 6.19 and have a clean tree. Whatever works.
Quoted 19 lines
scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/mod/modpost.c +1
-1@@ -953,7 +953,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,/* symbols in data sections that may refer to any init/exit sections */ if (match (fromsec,PATTERNS (DATA_SECTIONS )) &&match (tosec,PATTERNS (ALL_INIT_SECTIONS ,ALL_EXIT_SECTIONS )) && -match (fromsym,PATTERNS ("*_ops" ,"*_probe" ,"*_console" ))) +match (fromsym,PATTERNS ("*_ops" ,"*_console" )))return 0 ;/* Check for pattern 3 */ Signature · 1 line
2.49.1
Hi Nathan,
Quoted 28 lines · Nathan Chancellor
Quoted 18 lines · Johan Hovold
Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with
__devinitand__devexit, which have since been removed.Commit
e1dc1bfe5b27("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver.Turns out that was indeed an incorrect reference which has now been fixed by commit
9b685058ca93("irqchip/qcom-irq-combiner: Fix section mismatch").A recently added clocksource driver also relies on this suffix to suppress another valid warning, and that is being fixed separately. [1]
Note that drivers with valid reasons for suppressing the warnings can use the
__refmacros.Quoted 8 lines
Signed-off-by Johan Hovold <[email protected]>---
As mentioned above there are still two drivers relying on the "
_probe" pattern to suppress valid warnings so perhaps it's best to hold off on merging this until the corresponding fixes are in mainline (e.g. next cycle or so unless Thomas can fast-track them).
Quoted 5 lines
Yeah, if it were fast tracked as a fix for 6.18, we could either use that tag as the base for kbuild-next (as we have not take any patches for 6.19 yet) or if they are 6.19 material, Thomas could provide us with a signed tag or stable shared branch so that we could take this for 6.19 and have a clean tree. Whatever works.
Daniel has queued the clocksource fix for 6.19 now so I guess we can just wait until both fixes hit mainline and either send this one to Linus after that for -rc1 (or -rc2), or just wait until 6.20.
I'll send a reminder when both are in Linus's tree.
Quoted 1 line
Reviewed-by Nathan Chancellor <[email protected]>
Thanks for reviewing.
Quoted 15 lines
Quoted 15 lines
scripts/mod/modpost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/mod/modpost.c +1
-1@@ -953,7 +953,7 @@ static int secref_whitelist(const char *fromsec, const char *fromsym,/* symbols in data sections that may refer to any init/exit sections */ if (match (fromsec,PATTERNS (DATA_SECTIONS )) &&match (tosec,PATTERNS (ALL_INIT_SECTIONS ,ALL_EXIT_SECTIONS )) && -match (fromsym,PATTERNS ("*_ops" ,"*_probe" ,"*_console" ))) +match (fromsym,PATTERNS ("*_ops" ,"*_console" )))return 0 ;
Quoted 4 lines
Quoted 4 lines
scripts/mod/modpost.c +0
-0/* Check for pattern 3 */ Signature · 1 line
2.49.1
Johan
Nathan Chancellor
maintainerHi Johan,
Quoted 5 lines · Johan Hovold
Daniel has queued the clocksource fix for 6.19 now so I guess we can just wait until both fixes hit mainline and either send this one to Linus after that for -rc1 (or -rc2), or just wait until 6.20.
I'll send a reminder when both are in Linus's tree.
Thanks for the heads up! I think I would prefer having it bake in -next for a cycle so I will plan to apply it to kbuild-next once 6.19-rc1 is out. Then we should be able to catch any instances that crop up in new code from -next testing.
Cheers,
Nathan
Quoted 11 lines · Nathan Chancellor
Quoted 5 lines · Johan Hovold
Daniel has queued the clocksource fix for 6.19 now so I guess we can just wait until both fixes hit mainline and either send this one to Linus after that for -rc1 (or -rc2), or just wait until 6.20.
I'll send a reminder when both are in Linus's tree.
Thanks for the heads up! I think I would prefer having it bake in -next for a cycle so I will plan to apply it to kbuild-next once 6.19-rc1 is out. Then we should be able to catch any instances that crop up in new code from -next testing.
Sounds good, thanks.
Johan
Hi Nathan,
Quoted 11 lines · Nathan Chancellor
Quoted 5 lines · Johan Hovold
Daniel has queued the clocksource fix for 6.19 now so I guess we can just wait until both fixes hit mainline and either send this one to Linus after that for -rc1 (or -rc2), or just wait until 6.20.
I'll send a reminder when both are in Linus's tree.
Thanks for the heads up! I think I would prefer having it bake in -next for a cycle so I will plan to apply it to kbuild-next once 6.19-rc1 is out. Then we should be able to catch any instances that crop up in new code from -next testing.
Both fixes are in rc1 so you should be able to apply this one now.
Johan
Quoted 12 lines · Johan Hovold
Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with
__devinitand__devexit, which have since been removed.Commit
e1dc1bfe5b27("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver.Turns out that was indeed an incorrect reference which has now been fixed by commit
9b685058ca93("irqchip/qcom-irq-combiner: Fix section mismatch").
Quoted 8 lines
A recently added clocksource driver also relies on this suffix to suppress another valid warning, and that is being fixed separately. [1]
Note that drivers with valid reasons for suppressing the warnings can use the
__refmacros.Signed-off-by Johan Hovold <[email protected]>
Thanks for cleaning this up!
Nathan Chancellor
maintainerQuoted 9 lines · Johan Hovold
Several symbol patterns used to be whitelisted to allow drivers to refer to functions annotated with
__devinitand__devexit, which have since been removed.Commit
e1dc1bfe5b27("modpost: remove more symbol patterns from the section check whitelist") removed most of these patterns but left '*_probe' after a reported warning in an irqchip driver.[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git kbuild-next
Thanks!
[1/1] modpost: drop '*_probe' from section check whitelist
https://git.kernel.org/kbuild/c/a4df2071f1a2b
Please look out for regression or issue reports or other follow up comments, as they may result in the patch/series getting dropped or reverted.
Best regards,
Signature · 1 line
Nathan Chancellor <[email protected]>