linux/arch/x86/kernel/cpu/mcheck
Andreas Herrmann 903675569e x86: fix cpu-hotplug regression
Commit d435d862ba
("cpu hotplug: mce: fix cpu hotplug error handling")
changed the error handling in mce_cpu_callback.

In cases where not all CPUs are brought up during
boot (e.g. using maxcpus and additional_cpus parameters)
mce_cpu_callback now returns NOTFIY_BAD because
for such CPUs cpu_data is not completely filled when
the notifier is called. Thus mce_create_device fails right
at its beginning:

        if (!mce_available(&cpu_data[cpu]))
                return -EIO;

As a quick fix I suggest to check boot_cpu_data for MCE.

To reproduce this regression:

(1) boot with maxcpus=2 addtional_cpus=2 on a 4 CPU x86-64 system
(2) # echo 1 >/sys/devices/system/cpu/cpu2/online
  -bash: echo: write error: Invalid argument

dmesg shows:

_cpu_up: attempt to bring up CPU 2 failed

Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
2007-11-17 16:27:00 +01:00
..
Makefile x86: consolidate the cpu/ related code usage 2007-10-23 22:37:23 +02:00
k7.c i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00
mce.h i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00
mce_32.c x86: prepare consolidation of cpu/ related code usage 2007-10-23 22:37:23 +02:00
mce_64.c x86: fix cpu-hotplug regression 2007-11-17 16:27:00 +01:00
mce_amd_64.c x86: consolidate the cpu/ related code usage 2007-10-23 22:37:23 +02:00
mce_intel_64.c x86: consolidate the cpu/ related code usage 2007-10-23 22:37:23 +02:00
non-fatal.c i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00
p4.c x86: expand /proc/interrupts to include missing vectors, v2 2007-10-17 20:16:53 +02:00
p5.c i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00
p6.c i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00
therm_throt.c cpu hotplug: thermal_throttle: fix cpu hotplug error handling 2007-10-18 14:37:21 -07:00
winchip.c i386: move kernel/cpu/mcheck 2007-10-11 11:16:25 +02:00