MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
PATCH v2 1/1 MIPS: SMP-CPS: fix build error when HOTPLUG_CPU not set
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'
---
v2: use IS_ENABLED() instead of #ifdef-ery (Sergei)
arch/mips/kernel/smp-cps.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/mips/kernel/smp-cps.c +5 -3
@@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum cwmb (); } }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 ); + } } }
Quoted 31 lines · Randy Dunlap
When MIPS_CPS=y,
MIPS_CPS_PMis not set,HOTPLUG_CPUis not set, and KEXEC=y,cps_shutdown_this_cpu()attempts to callcps_pm_enter_state(), which is not built whenMIPS_CPS_PMis not set. Conditionally execute the else branch based onCONFIG_HOTPLUG_CPUto 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 <[email protected]>Cc Dengcheng Zhu <[email protected]>Cc Paul Burton <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Cc Sergei Shtylyov <[email protected]>---
v2: useIS_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.cb/arch/mips/kernel/smp-cps.carch/mips/kernel/smp-cps.c +0
-1@@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum cwmb (); } }else { -pr_debug ("Gating power to core %d\n" , core);
arch/mips/kernel/smp-cps.c static void cps_shutdown_this_cpu(enum c · line 434
Quoted 10 lines
arch/mips/kernel/smp-cps.c +5
-2-/* 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.
Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]
Quoted 17 lines · Randy Dunlap
When MIPS_CPS=y,
MIPS_CPS_PMis not set,HOTPLUG_CPUis not set, and KEXEC=y,cps_shutdown_this_cpu()attempts to callcps_pm_enter_state(), which is not built whenMIPS_CPS_PMis not set. Conditionally execute the else branch based onCONFIG_HOTPLUG_CPUto 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 <[email protected]>Cc Dengcheng Zhu <[email protected]>Cc Paul Burton <[email protected]>Cc Thomas Bogendoerfer <[email protected]>Cc Sergei Shtylyov <[email protected]>
Quoted 5 lines
---
v2: useIS_ENABLED()instead of #ifdef-ery (Sergei)arch/mips/kernel/smp-cps.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)