Skip to content

Commit 6f02e39

Browse files
rddunlaptsbogend
authored andcommitted
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' Fixes: 1447864 ("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> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
1 parent ab47b3d commit 6f02e39

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

arch/mips/kernel/smp-cps.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -424,9 +424,11 @@ static void cps_shutdown_this_cpu(enum cpu_death death)
424424
wmb();
425425
}
426426
} else {
427-
pr_debug("Gating power to core %d\n", core);
428-
/* Power down the core */
429-
cps_pm_enter_state(CPS_PM_POWER_GATED);
427+
if (IS_ENABLED(CONFIG_HOTPLUG_CPU)) {
428+
pr_debug("Gating power to core %d\n", core);
429+
/* Power down the core */
430+
cps_pm_enter_state(CPS_PM_POWER_GATED);
431+
}
430432
}
431433
}
432434

0 commit comments

Comments
 (0)