aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bp@suse.de>2014-06-20 17:16:45 -0400
committerBorislav Petkov <bp@suse.de>2014-06-24 09:17:01 -0400
commit27c934158c5be0bebfb2970da521b9d9efc0058b (patch)
treee943e5c07306850caca97f81c8c387b826c7e2f8
parent38356c1fbd8cd0f44a32ede2c97f0eb639d06613 (diff)
x86, MCE: Robustify mcheck_init_device
BorisO reports that misc_register() fails often on xen. The current code unregisters the CPU hotplug notifier in that case. If then a CPU is offlined and onlined back again, we end up with a second timer running on that CPU, leading to soft lockups and system hangs. So let's leave the hotcpu notifier always registered - even if mce_device_create failed for some cores and never unreg it so that we can deal with the timer handling accordingly. Reported-and-Tested-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> Link: http://lkml.kernel.org/r/1403274493-1371-1-git-send-email-boris.ostrovsky@oracle.com Signed-off-by: Borislav Petkov <bp@suse.de>
-rw-r--r--arch/x86/kernel/cpu/mcheck/mce.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index 8fecdd34f2d2..4fc57975acc1 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2450,6 +2450,12 @@ static __init int mcheck_init_device(void)
2450 for_each_online_cpu(i) { 2450 for_each_online_cpu(i) {
2451 err = mce_device_create(i); 2451 err = mce_device_create(i);
2452 if (err) { 2452 if (err) {
2453 /*
2454 * Register notifier anyway (and do not unreg it) so
2455 * that we don't leave undeleted timers, see notifier
2456 * callback above.
2457 */
2458 __register_hotcpu_notifier(&mce_cpu_notifier);
2453 cpu_notifier_register_done(); 2459 cpu_notifier_register_done();
2454 goto err_device_create; 2460 goto err_device_create;
2455 } 2461 }
@@ -2470,10 +2476,6 @@ static __init int mcheck_init_device(void)
2470err_register: 2476err_register:
2471 unregister_syscore_ops(&mce_syscore_ops); 2477 unregister_syscore_ops(&mce_syscore_ops);
2472 2478
2473 cpu_notifier_register_begin();
2474 __unregister_hotcpu_notifier(&mce_cpu_notifier);
2475 cpu_notifier_register_done();
2476
2477err_device_create: 2479err_device_create:
2478 /* 2480 /*
2479 * We didn't keep track of which devices were created above, but 2481 * We didn't keep track of which devices were created above, but