* [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
@ 2023-02-17 20:07 Randy Dunlap
2023-02-19 8:30 ` Thomas Bogendoerfer
2023-02-19 22:12 ` Philippe Mathieu-Daudé
0 siblings, 2 replies; 3+ messages in thread
From: Randy Dunlap @ 2023-02-17 20:07 UTC (permalink / raw)
To: linux-kernel
Cc: Randy Dunlap, Dengcheng Zhu, Paul Burton, Thomas Bogendoerfer,
linux-mips, Sergei Shtylyov
When MIPS_CPS=y, MIPS_CPS_PM is not set, HOTPLUG_CPU is not set, and
KEXEC=y, cps_shutdown_this_cpu() attempts to call cps_pm_enter_state(),
which is not built when MIPS_CPS_PM is not set.
Conditionally execute the else branch based on CONFIG_HOTPLUG_CPU
to remove the build error.
This build failure is from a randconfig file.
mips-linux-ld: arch/mips/kernel/smp-cps.o: in function `$L162':
smp-cps.c:(.text.cps_kexec_nonboot_cpu+0x31c): undefined reference to `cps_pm_enter_state'
Fixes: 1447864bee4c ("MIPS: kexec: CPS systems to halt nonboot CPUs")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Dengcheng Zhu <dzhu@wavecomp.com>
Cc: Paul Burton <paulburton@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: linux-mips@vger.kernel.org
Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>
---
v2: use IS_ENABLED() instead of #ifdef-ery (Sergei)
arch/mips/kernel/smp-cps.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff -- a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
--- a/arch/mips/kernel/smp-cps.c
+++ b/arch/mips/kernel/smp-cps.c
@@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum c
wmb();
}
} else {
- pr_debug("Gating power to core %d\n", core);
- /* Power down the core */
- cps_pm_enter_state(CPS_PM_POWER_GATED);
+ if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
+ pr_debug("Gating power to core %d\n", core);
+ /* Power down the core */
+ cps_pm_enter_state(CPS_PM_POWER_GATED);
+ }
}
}
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
2023-02-17 20:07 [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Randy Dunlap
@ 2023-02-19 8:30 ` Thomas Bogendoerfer
2023-02-19 22:12 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2023-02-19 8:30 UTC (permalink / raw)
To: Randy Dunlap
Cc: linux-kernel, Dengcheng Zhu, Paul Burton, linux-mips,
Sergei Shtylyov
On Fri, Feb 17, 2023 at 12:07:49PM -0800, Randy Dunlap wrote:
> When MIPS_CPS=y, MIPS_CPS_PM is not set, HOTPLUG_CPU is not set, and
> KEXEC=y, cps_shutdown_this_cpu() attempts to call cps_pm_enter_state(),
> which is not built when MIPS_CPS_PM is not set.
> Conditionally execute the else branch based on CONFIG_HOTPLUG_CPU
> to remove the build error.
> This build failure is from a randconfig file.
>
> mips-linux-ld: arch/mips/kernel/smp-cps.o: in function `$L162':
> smp-cps.c:(.text.cps_kexec_nonboot_cpu+0x31c): undefined reference to `cps_pm_enter_state'
>
> Fixes: 1447864bee4c ("MIPS: kexec: CPS systems to halt nonboot CPUs")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Dengcheng Zhu <dzhu@wavecomp.com>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>
> ---
> v2: use IS_ENABLED() instead of #ifdef-ery (Sergei)
>
> arch/mips/kernel/smp-cps.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff -- a/arch/mips/kernel/smp-cps.c b/arch/mips/kernel/smp-cps.c
> --- a/arch/mips/kernel/smp-cps.c
> +++ b/arch/mips/kernel/smp-cps.c
> @@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum c
> wmb();
> }
> } else {
> - pr_debug("Gating power to core %d\n", core);
> - /* Power down the core */
> - cps_pm_enter_state(CPS_PM_POWER_GATED);
> + if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
> + pr_debug("Gating power to core %d\n", core);
> + /* Power down the core */
> + cps_pm_enter_state(CPS_PM_POWER_GATED);
> + }
> }
> }
>
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
2023-02-17 20:07 [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Randy Dunlap
2023-02-19 8:30 ` Thomas Bogendoerfer
@ 2023-02-19 22:12 ` Philippe Mathieu-Daudé
1 sibling, 0 replies; 3+ messages in thread
From: Philippe Mathieu-Daudé @ 2023-02-19 22:12 UTC (permalink / raw)
To: Randy Dunlap, linux-kernel
Cc: Dengcheng Zhu, Paul Burton, Thomas Bogendoerfer, linux-mips,
Sergei Shtylyov
On 17/2/23 21:07, Randy Dunlap wrote:
> When MIPS_CPS=y, MIPS_CPS_PM is not set, HOTPLUG_CPU is not set, and
> KEXEC=y, cps_shutdown_this_cpu() attempts to call cps_pm_enter_state(),
> which is not built when MIPS_CPS_PM is not set.
> Conditionally execute the else branch based on CONFIG_HOTPLUG_CPU
> to remove the build error.
> This build failure is from a randconfig file.
>
> mips-linux-ld: arch/mips/kernel/smp-cps.o: in function `$L162':
> smp-cps.c:(.text.cps_kexec_nonboot_cpu+0x31c): undefined reference to `cps_pm_enter_state'
>
> Fixes: 1447864bee4c ("MIPS: kexec: CPS systems to halt nonboot CPUs")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Dengcheng Zhu <dzhu@wavecomp.com>
> Cc: Paul Burton <paulburton@kernel.org>
> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
> Cc: linux-mips@vger.kernel.org
> Cc: Sergei Shtylyov <sergei.shtylyov@gmail.com>
> ---
> v2: use IS_ENABLED() instead of #ifdef-ery (Sergei)
>
> arch/mips/kernel/smp-cps.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2023-02-19 22:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-17 20:07 [PATCH v2] MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set Randy Dunlap
2023-02-19 8:30 ` Thomas Bogendoerfer
2023-02-19 22:12 ` Philippe Mathieu-Daudé
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).