Re: [PATCH] x86: fix cpu-hotplug regression

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Andreas Herrmann
Date: Wednesday, November 7, 2007 - 6:18 am

On Wed, Nov 07, 2007 at 03:35:43AM +0100, Andi Kleen wrote:

Yes, and this was the old behaviour. The mentioned patch changed it -
("do mce_create_device in CPU_UP_PREPARE instead of CPU_ONLINE").

Thinking twice about the problem it seems obvious that this part
of the patch should just be reverted.

Attached is a new fix (diff against 2.6.24-rc2).


Regards,

Andreas

--
[PATCH] x86: fix cpu hotplug regression (don't call mce_create_device on CPU_UP_PREPARE)

Fix regression introduced with d435d862baca3e25e5eec236762a43251b1e7ffc
("cpu hotplug: mce: fix cpu hotplug error handling").

For CPUs not brought up during boot (using maxcpus and additional_cpus
parameters) we don't know whether mce is supported or not at "CPU_UP_PREPARE"-time.
Thus mce_cpu_callback should be called after the CPU is online.


Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
---
 arch/x86/kernel/cpu/mcheck/mce_64.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_64.c b/arch/x86/kernel/cpu/mcheck/mce_64.c
index b9f802e..8e83070 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_64.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_64.c
@@ -855,12 +855,10 @@ mce_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
 	int err = 0;
 
 	switch (action) {
-	case CPU_UP_PREPARE:
-	case CPU_UP_PREPARE_FROZEN:
+	case CPU_ONLINE:
+	case CPU_ONLINE_FROZEN:
 		err = mce_create_device(cpu);
 		break;
-	case CPU_UP_CANCELED:
-	case CPU_UP_CANCELED_FROZEN:
 	case CPU_DEAD:
 	case CPU_DEAD_FROZEN:
 		mce_remove_device(cpu);
-- 
1.5.3.4




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

Messages in current thread:
[PATCH] x86: fix cpu-hotplug regression, Andreas Herrmann, (Tue Nov 6, 6:12 pm)
Re: [PATCH] x86: fix cpu-hotplug regression, Andi Kleen, (Tue Nov 6, 7:35 pm)
Re: [PATCH] x86: fix cpu-hotplug regression, Andreas Herrmann, (Wed Nov 7, 6:18 am)
Re: [PATCH] x86: fix cpu-hotplug regression, Akinobu Mita, (Wed Nov 7, 7:15 am)
Re: [PATCH] x86: fix cpu-hotplug regression, Andrew Morton, (Fri Nov 9, 1:16 pm)
Re: [PATCH] x86: fix cpu-hotplug regression, Andreas Herrmann, (Mon Nov 12, 3:07 am)
[PATCH] x86: don't call mce_create_device on CPU_UP_PREPARE, Andreas Herrmann, (Mon Nov 12, 10:38 am)