[PATCH -mm 6/8] Schedule sysrq poweroff on boot cpu

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Rafael J. Wysocki
Date: Wednesday, July 9, 2008 - 5:04 pm

From: Zhang Rui <rui.zhang@intel.com>
Subject: Schedule sysrq poweroff on boot cpu

schedule sysrq poweroff on boot cpu.

sysrq poweroff needs to disable nonboot cpus, and we need to run this
on boot cpu to avoid any recursion.
http://bugzilla.kernel.org/show_bug.cgi?id=10897

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
tested-by: Rus <harbour@sfinx.od.ua>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 kernel/power/poweroff.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux-2.6/kernel/power/poweroff.c
===================================================================
--- linux-2.6.orig/kernel/power/poweroff.c	2008-06-30 16:01:35.000000000 +0800
+++ linux-2.6/kernel/power/poweroff.c	2008-07-03 10:50:05.000000000 +0800
@@ -25,7 +25,8 @@
 
 static void handle_poweroff(int key, struct tty_struct *tty)
 {
-	schedule_work(&poweroff_work);
+	/* run sysrq poweroff on boot cpu */
+	schedule_work_on(first_cpu(cpu_online_map), &poweroff_work);
 }
 
 static struct sysrq_key_op	sysrq_poweroff_op = {





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

Messages in current thread:
[PATCH -mm 0/8] PM patches for 2.6.27, Rafael J. Wysocki, (Wed Jul 9, 4:52 pm)
[PATCH -mm 2/8] AHCI: Speed-up resume, Rafael J. Wysocki, (Wed Jul 9, 4:58 pm)
[PATCH -mm 3/8] Hibernation: Simplify memory bitmap, Rafael J. Wysocki, (Wed Jul 9, 5:00 pm)
[PATCH -mm 4/8] serio: Speed-up resume, Rafael J. Wysocki, (Wed Jul 9, 5:01 pm)
[PATCH -mm 5/8] Introduce new interface schedule_work_on, Rafael J. Wysocki, (Wed Jul 9, 5:03 pm)
[PATCH -mm 6/8] Schedule sysrq poweroff on boot cpu, Rafael J. Wysocki, (Wed Jul 9, 5:04 pm)
[PATCH -mm 7/8] ACPI hibernation: Utilize hardware signature, Rafael J. Wysocki, (Wed Jul 9, 5:05 pm)
Re: [PATCH -mm 2/8] AHCI: Speed-up resume, Pavel Machek, (Thu Jul 10, 4:34 am)
Re: [PATCH -mm 3/8] Hibernation: Simplify memory bitmap, Pavel Machek, (Thu Jul 10, 4:34 am)
Re: [PATCH -mm 4/8] serio: Speed-up resume, Pavel Machek, (Thu Jul 10, 4:35 am)
Re: [PATCH -mm 6/8] Schedule sysrq poweroff on boot cpu, Pavel Machek, (Thu Jul 10, 4:36 am)
Re: [PATCH -mm 4/8] serio: Speed-up resume, Dmitry Torokhov, (Thu Jul 10, 8:11 am)