[patch 09/12] Fix SMP poweroff hangs

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Greg KH
Date: Monday, October 8, 2007 - 11:06 am

From: Mark Lord <lkml@rtr.ca>

commit 4047727e5ae33f9b8d2b7766d1994ea6e5ec2991 from upstream

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 kernel/sys.c |    2 ++
 1 file changed, 2 insertions(+)

--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -31,6 +31,7 @@
 #include <linux/cn_proc.h>
 #include <linux/getcpu.h>
 #include <linux/task_io_accounting_ops.h>
+#include <linux/cpu.h>
 
 #include <linux/compat.h>
 #include <linux/syscalls.h>
@@ -865,6 +866,7 @@ EXPORT_SYMBOL_GPL(kernel_halt);
 void kernel_power_off(void)
 {
 	kernel_shutdown_prepare(SYSTEM_POWER_OFF);
+	disable_nonboot_cpus();
 	printk(KERN_EMERG "Power down.\n");
 	machine_power_off();
 }

-- 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 00/12] 2.6.22.10 -stable review, Greg KH, (Mon Oct 8, 11:05 am)
[patch 03/12] sky2: fix VLAN receive processing, Greg KH, (Mon Oct 8, 11:06 am)
[patch 04/12] sky2: fix transmit state on resume, Greg KH, (Mon Oct 8, 11:06 am)
[patch 05/12] libata: update drive blacklists, Greg KH, (Mon Oct 8, 11:06 am)
[patch 06/12] Fix ppp_mppe kernel stack usage., Greg KH, (Mon Oct 8, 11:06 am)
[patch 09/12] Fix SMP poweroff hangs, Greg KH, (Mon Oct 8, 11:06 am)
Re: [patch 00/12] 2.6.22.10 -stable review, Greg KH, (Mon Oct 8, 11:09 am)
Re: [patch 09/12] Fix SMP poweroff hangs, Olof Johansson, (Tue Oct 9, 8:17 am)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Thomas Gleixner, (Tue Oct 9, 4:21 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Linus Torvalds, (Tue Oct 9, 4:27 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Thomas Gleixner, (Tue Oct 9, 4:35 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Olof Johansson, (Tue Oct 9, 5:03 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Linus Torvalds, (Tue Oct 9, 10:29 pm)
Re: [stable] [patch 09/12] Fix SMP poweroff hangs, Paul Mackerras, (Wed Oct 10, 5:24 pm)