Skip to content

Commit

Permalink
x86/mce: Fix CPU hotplug and suspend regression related to MCE
Browse files Browse the repository at this point in the history
Commit 8a25a2f ("cpu: convert 'cpu' and 'machinecheck' sysdev_class
to a regular subsystem") changed how things are dealt with in the MCE
subsystem.  Some of the things that got broken due to this are CPU
hotplug and suspend/hibernate.

MCE uses per_cpu allocations of struct device.  So, when a CPU goes
offline and comes back online, in order to ensure that we start from a
clean slate with respect to the MCE subsystem, zero out the entire
per_cpu device structure to 0 before using it.

Signed-off-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Srivatsa S. Bhat authored and Linus Torvalds committed Jan 14, 2012
1 parent 96e80a7 commit a3301b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/kernel/cpu/mcheck/mce.c
Original file line number Diff line number Diff line change
Expand Up @@ -2011,7 +2011,7 @@ static __cpuinit int mce_device_create(unsigned int cpu)
if (!mce_available(&boot_cpu_data))
return -EIO;

memset(&dev->kobj, 0, sizeof(struct kobject));
memset(dev, 0, sizeof(struct device));
dev->id = cpu;
dev->bus = &mce_subsys;

Expand Down

0 comments on commit a3301b7

Please sign in to comment.