Fix SMP poweroff hangs

We need to disable all CPUs other than the boot CPU (usually 0) before
attempting to power-off modern SMP machines. This fixes the
hang-on-poweroff issue on my MythTV SMP box, and also on Thomas Gleixner's
new toybox.

Signed-off-by: Mark Lord <mlord@pobox.com>
Acked-by: Thomas Gleixner <tglx@linutronix.de>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by Mark Lord and committed by Linus Torvalds 4047727e 281e0e3b

+2
+2
kernel/sys.c
··· 32 32 #include <linux/getcpu.h> 33 33 #include <linux/task_io_accounting_ops.h> 34 34 #include <linux/seccomp.h> 35 + #include <linux/cpu.h> 35 36 36 37 #include <linux/compat.h> 37 38 #include <linux/syscalls.h> ··· 879 878 kernel_shutdown_prepare(SYSTEM_POWER_OFF); 880 879 if (pm_power_off_prepare) 881 880 pm_power_off_prepare(); 881 + disable_nonboot_cpus(); 882 882 sysdev_shutdown(); 883 883 printk(KERN_EMERG "Power down.\n"); 884 884 machine_power_off();