cpuidle: pseries: Mark pseries_idle_proble() as __init
Subsystems (2)
PATCH 1/1 cpuidle: pseries: Mark pseries_idle_proble() as __init
After commit 7cbd631d4dec ("cpuidle: pseries: Fixup CEDE0 latency only for POWER10 onwards"), pseries_idle_probe() is no longer inlined when compiling with clang, which causes a modpost warning:
WARNING: modpost: vmlinux.o(.text+0xc86a54): Section mismatch in reference from the function pseries_idle_probe() to the function .init.text:fixup_cede0_latency()
The function pseries_idle_probe() references
the function __init fixup_cede0_latency().
This is often because pseries_idle_probe lacks a __init annotation or the annotation of fixup_cede0_latency is wrong.
pseries_idle_probe() is a non-init function, which calls fixup_cede0_latency(), which is an init function, explaining the mismatch. pseries_idle_probe() is only called from pseries_processor_idle_init(), which is an init function, so mark pseries_idle_probe() as __init so there is no more warning.
--- drivers/cpuidle/cpuidle-pseries.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpuidle/cpuidle-pseries.c +1 -1
@@ -403,7 +403,7 @@ static void __init fixup_cede0_latency(void)* pseries_idle_probe() * Choose state table for shared versus dedicated partition */ -static int pseries_idle_probe (void ) +static int __init pseries_idle_probe (void ) {if (cpuidle_disable !=IDLE_NO_OVERRIDE )
base-commit: a6cae77f1bc89368a4e2822afcddc45c3062d499
Signature · 1 line
2.33.0.rc0
Michael Ellerman
reviewerQuoted 18 lines · Nathan Chancellor
After commit
7cbd631d4dec("cpuidle: pseries: Fixup CEDE0 latency only for POWER10 onwards"),pseries_idle_probe()is no longer inlined when compiling with clang, which causes a modpost warning:WARNING: modpost:
vmlinux.o(.text+0xc86a54): Section mismatch in reference from the functionpseries_idle_probe()to the function .init.text:fixup_cede0_latency()
The functionpseries_idle_probe()references
the function__initfixup_cede0_latency().
This is often becausepseries_idle_probelacks a__initannotation or the annotation offixup_cede0_latencyis wrong.
pseries_idle_probe()is a non-init function, which callsfixup_cede0_latency(), which is an init function, explaining the mismatch.pseries_idle_probe()is only called frompseries_processor_idle_init(), which is an init function, so markpseries_idle_probe()as__initso there is no more warning.
Quoted 5 lines
Fixes 054e44ba99ae ("cpuidle: pseries: Add function to parse extended CEDE records")Signed-off-by Nathan Chancellor <[email protected]>--- drivers/cpuidle/cpuidle-pseries.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
I don't see this in my builds for some reason, but I guess toolchain or config differences probably explain it.
Regardless, the patch is correct so I'll pick it up, thanks.
cheers
Quoted 17 lines
drivers/cpuidle/cpuidle-pseries.c +1
-1@@ -403,7 +403,7 @@ static void __init fixup_cede0_latency(void)* pseries_idle_probe() * Choose state table for shared versus dedicated partition */ -static int pseries_idle_probe (void ) +static int __init pseries_idle_probe (void ) {if (cpuidle_disable !=IDLE_NO_OVERRIDE )base-commit:
a6cae77f1bc89368a4e2822afcddc45c3062d499Signature · 1 line
2.33.0.rc0
Michael Ellerman
AppliedQuoted 12 lines · Nathan Chancellor
After commit
7cbd631d4dec("cpuidle: pseries: Fixup CEDE0 latency only for POWER10 onwards"),pseries_idle_probe()is no longer inlined when compiling with clang, which causes a modpost warning:WARNING: modpost:
vmlinux.o(.text+0xc86a54): Section mismatch in reference from the functionpseries_idle_probe()to the function .init.text:fixup_cede0_latency()
The functionpseries_idle_probe()references
the function__initfixup_cede0_latency().
This is often becausepseries_idle_probelacks a__initannotation or the annotation offixup_cede0_latencyis wrong.
Quoted 1 line
[...]
Applied to powerpc/next.
[1/1] cpuidle: pseries: Mark pseries_idle_proble() as __init
https://git.kernel.org/powerpc/c/d04691d373e75c83424b85c0e68e4a3f9370c10d
cheers