Re: Problems with SMP & ACPI powering off

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Rafael J. Wysocki <rjw@...>
Cc: Len Brown <lenb@...>, Linux Kernel <linux-kernel@...>, <simon.derr@...>
Date: Friday, September 28, 2007 - 9:22 am

Rafael J. Wysocki wrote:

Well, so far it's working:  about ten poweroffs since I patched it,
and no issues with any of them.  Prior to that, it seemed like about
one in five poweroffs wouldn't (power off).

It'll take a lot more testing to confirm, though.

What can I call to determine if more than one CPU is enabled, anyway?

Here's the hack I'm using here, very situation (2 cores) specific,
and it still has some printk's leftover with a sleep so I have time
to read them before the lights go out.  :)

--- old/arch/i386/kernel/reboot.c	2007-09-27 17:17:00.000000000 -0400
+++ linux/arch/i386/kernel/reboot.c	2007-09-27 17:15:35.000000000 -0400
@@ -393,8 +393,22 @@
 	.halt = native_machine_halt,
 };
 
+static void kill_cpu1(void)
+{
+	extern int cpu_down(unsigned int cpu);
+
+	printk(KERN_EMERG "kill_cpu1: was running on CPU%d\n", smp_processor_id());
+	/* Some bioses don't like being called from CPU != 0 */
+	set_cpus_allowed(current, cpumask_of_cpu(0));
+	printk(KERN_EMERG "kill_cpu1: now running on CPU%d\n", smp_processor_id());
+	cpu_down(1);
+	printk(KERN_EMERG "kill_cpu1: done\n");
+	msleep(1000);
+}
+
 void machine_power_off(void)
 {
+	(void)kill_cpu1();
 	machine_ops.power_off();
 }
 
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Problems with SMP &amp; ACPI powering off, Mark Lord, (Thu Sep 27, 5:29 pm)
Re: Problems with SMP &amp; ACPI powering off, Rafael J. Wysocki, (Thu Sep 27, 6:00 pm)
Re: Problems with SMP &amp; ACPI powering off, Len Brown, (Fri Sep 28, 12:57 am)
Re: Problems with SMP &amp; ACPI powering off, Rafael J. Wysocki, (Fri Sep 28, 8:55 am)
Re: Problems with SMP & ACPI powering off, Mark Lord, (Fri Sep 28, 9:22 am)
Re: Problems with SMP &amp; ACPI powering off, Rafael J. Wysocki, (Fri Sep 28, 9:44 am)
Re: Problems with SMP &amp; ACPI powering off, Mark Lord, (Fri Sep 28, 9:46 am)
[PATCH] disable non-boot CPUs before poweroff, Mark Lord, (Fri Sep 28, 9:52 am)
Re: [PATCH] disable non-boot CPUs before poweroff, Thomas Gleixner, (Fri Sep 28, 10:55 am)
[PATCH] (repost) Fix SMP poweroff hangs, Mark Lord, (Fri Sep 28, 3:53 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Santiago Garcia Mantinan, (Sun Sep 30, 5:00 am)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Mark Lord, (Sun Sep 30, 1:21 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Santiago Garcia Mantinan, (Sun Sep 30, 1:54 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Rafael J. Wysocki, (Mon Oct 1, 4:05 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Santiago Garcia Mantinan, (Mon Oct 1, 6:38 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Mark Lord, (Sun Sep 30, 2:47 pm)
Re: [PATCH] (repost) Fix SMP poweroff hangs, Santiago Garcia Mantinan, (Sun Sep 30, 4:03 pm)
Re: 32-bit Athlon X2 won't poweroff (was: Fix SMP poweroff..., Santiago Garcia Mantinan, (Mon Oct 1, 12:19 pm)
Re: 32-bit Athlon X2 won't poweroff , Mark Lord, (Mon Oct 1, 12:37 pm)
Re: 32-bit Athlon X2 won't poweroff , Mark Lord, (Sun Sep 30, 6:56 pm)
Re: [PATCH] disable non-boot CPUs before poweroff, Rafael J. Wysocki, (Fri Sep 28, 11:05 am)
Re: [PATCH] disable non-boot CPUs before poweroff, Thomas Gleixner, (Fri Sep 28, 11:02 am)
Re: [PATCH] disable non-boot CPUs before poweroff, Mark Lord, (Fri Sep 28, 10:11 am)
Re: Problems with SMP &amp; ACPI powering off, Mark Lord, (Thu Sep 27, 7:07 pm)
Re: Problems with SMP &amp; ACPI powering off, Mark Lord, (Thu Sep 27, 5:30 pm)