| Submitter | Johannes Berg |
|---|---|
| Date | Sept. 25, 2008, 8:56 a.m. |
| Message ID | <1222332986.10563.35.camel@johannes.berg> |
| Download | mbox | patch |
| Permalink | /patch/1467/ |
| State | Accepted |
| Commit | 61e9916eba35dfb76d38013a5aae9a59cc50877a |
| Delegated to: | Benjamin Herrenschmidt |
| Headers | show |
Comments
> From: Johannes Berg <johannes@sipsolutions.net> > Subject: powerpc: fix shutdown > > I tracked down the shutdown regression to CPUs not dying > when being shut down during power-off. This turns out to > be due to the system_state being SYSTEM_POWER_OFF, which > this code doesn't take as a valid state for shutting off > CPUs in. > > This has never made sense to me, but when I added hotplug > code to implement hibernate I only "made it work" and did > not question the need to check the system_state. Thomas > Gleixner helped me dig, but the only thing we found is > that it was added with the original commit that added CPU > hotplug support. > > Signed-off-by: Johannes Berg <johannes@sipsolutions.net> > Cc: Thomas Gleixner <tglx@linutronix.de> > Cc: Joel Schopp <jschopp@austin.ibm.com> > Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> > Tested this patch on a Power6 partition with cpu hotplug online/offline and some shutdown and reboot cycles. Didn't see any ill effects. Acked-by: Joel Schopp <jschopp@austin.ibm.com>
Patch
--- everything.orig/arch/powerpc/kernel/idle.c 2008-09-01 12:28:37.000000000 +0200 +++ everything/arch/powerpc/kernel/idle.c 2008-09-25 10:55:45.000000000 +0200 @@ -34,11 +34,7 @@ #include <asm/smp.h> #ifdef CONFIG_HOTPLUG_CPU -/* this is used for software suspend, and that shuts down - * CPUs even while the system is still booting... */ -#define cpu_should_die() (cpu_is_offline(smp_processor_id()) && \ - (system_state == SYSTEM_RUNNING \ - || system_state == SYSTEM_BOOTING)) +#define cpu_should_die() cpu_is_offline(smp_processor_id()) #else #define cpu_should_die() 0 #endif