diff options
author | Borislav Petkov <bp@suse.de> | 2014-06-20 17:16:45 -0400 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2014-07-21 12:14:32 -0400 |
commit | 51cbe7e7c400def749950ab6b2c120624dbe21a7 (patch) | |
tree | 4dad4c11bc99e9596fa5e6c6d0bb426388ec957d /arch | |
parent | 9a3c4145af32125c5ee39c0272662b47307a8323 (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>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce.c | 10 |
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 bb92f38153b2..9a79c8dbd8e8 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
@@ -2451,6 +2451,12 @@ static __init int mcheck_init_device(void) | |||
2451 | for_each_online_cpu(i) { | 2451 | for_each_online_cpu(i) { |
2452 | err = mce_device_create(i); | 2452 | err = mce_device_create(i); |
2453 | if (err) { | 2453 | if (err) { |
2454 | /* | ||
2455 | * Register notifier anyway (and do not unreg it) so | ||
2456 | * that we don't leave undeleted timers, see notifier | ||
2457 | * callback above. | ||
2458 | */ | ||
2459 | __register_hotcpu_notifier(&mce_cpu_notifier); | ||
2454 | cpu_notifier_register_done(); | 2460 | cpu_notifier_register_done(); |
2455 | goto err_device_create; | 2461 | goto err_device_create; |
2456 | } | 2462 | } |
@@ -2471,10 +2477,6 @@ static __init int mcheck_init_device(void) | |||
2471 | err_register: | 2477 | err_register: |
2472 | unregister_syscore_ops(&mce_syscore_ops); | 2478 | unregister_syscore_ops(&mce_syscore_ops); |
2473 | 2479 | ||
2474 | cpu_notifier_register_begin(); | ||
2475 | __unregister_hotcpu_notifier(&mce_cpu_notifier); | ||
2476 | cpu_notifier_register_done(); | ||
2477 | |||
2478 | err_device_create: | 2480 | err_device_create: |
2479 | /* | 2481 | /* |
2480 | * We didn't keep track of which devices were created above, but | 2482 | * We didn't keep track of which devices were created above, but |