LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init
@ 2021-08-03 21:15 Nathan Chancellor
  2021-08-04  0:54 ` Michael Ellerman
  2021-08-18 13:38 ` Michael Ellerman
  0 siblings, 2 replies; 3+ messages in thread
From: Nathan Chancellor @ 2021-08-03 21:15 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Nick Desaulniers,
	Gautham R. Shenoy, linux-pm, linuxppc-dev, linux-kernel,
	clang-built-linux, 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 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.

Fixes: 054e44ba99ae ("cpuidle: pseries: Add function to parse extended CEDE records")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/cpuidle/cpuidle-pseries.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
index bba449b77641..7e7ab5597d7a 100644
--- a/drivers/cpuidle/cpuidle-pseries.c
+++ b/drivers/cpuidle/cpuidle-pseries.c
@@ -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
-- 
2.33.0.rc0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init
  2021-08-03 21:15 [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init Nathan Chancellor
@ 2021-08-04  0:54 ` Michael Ellerman
  2021-08-18 13:38 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-08-04  0:54 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: Benjamin Herrenschmidt, Paul Mackerras, Nick Desaulniers,
	Gautham R. Shenoy, linux-pm, linuxppc-dev, linux-kernel,
	clang-built-linux, Nathan Chancellor

Nathan Chancellor <nathan@kernel.org> writes:
> 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.
>
> Fixes: 054e44ba99ae ("cpuidle: pseries: Add function to parse extended CEDE records")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>  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

> diff --git a/drivers/cpuidle/cpuidle-pseries.c b/drivers/cpuidle/cpuidle-pseries.c
> index bba449b77641..7e7ab5597d7a 100644
> --- a/drivers/cpuidle/cpuidle-pseries.c
> +++ b/drivers/cpuidle/cpuidle-pseries.c
> @@ -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
> -- 
> 2.33.0.rc0

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init
  2021-08-03 21:15 [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init Nathan Chancellor
  2021-08-04  0:54 ` Michael Ellerman
@ 2021-08-18 13:38 ` Michael Ellerman
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2021-08-18 13:38 UTC (permalink / raw)
  To: Michael Ellerman, Nathan Chancellor
  Cc: Gautham R. Shenoy, Paul Mackerras, linux-kernel,
	clang-built-linux, linux-pm, Nick Desaulniers, linuxppc-dev,
	Benjamin Herrenschmidt

On Tue, 3 Aug 2021 14:15:47 -0700, Nathan Chancellor wrote:
> 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.
> 
> [...]

Applied to powerpc/next.

[1/1] cpuidle: pseries: Mark pseries_idle_proble() as __init
      https://git.kernel.org/powerpc/c/d04691d373e75c83424b85c0e68e4a3f9370c10d

cheers

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-18 13:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-03 21:15 [PATCH] cpuidle: pseries: Mark pseries_idle_proble() as __init Nathan Chancellor
2021-08-04  0:54 ` Michael Ellerman
2021-08-18 13:38 ` Michael Ellerman

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).