x86: Merge tag 'ras_urgent' into x86/urgent

Promote one fix for 3.16

This fix was necessary after

9c15a24b038f ("x86/mce: Improve mcheck_init_device() error handling")

went in. What this patch did was, among others, check the return value
of misc_register and exit early if it encountered an error. Original
code sloppily didn't do that.

However,

cef12ee52b05 ("xen/mce: Add mcelog support for Xen platform")

made it so that xen's init routine xen_late_init_mcelog runs first. This
was needed for the xen mcelog device which is supposed to be independent
from the baremetal one.

Initially it was reported that misc_register() fails often on xen and
that's why it needed fixing. However, it is *supposed* to fail by
design, when running in dom0 so that the xen mcelog device file gets
registered first.

And *then* you need the notifier *not* unregistered on the error path so
that the timer does get deleted properly in the CPU hotplug notifier.

Btw, this fix is needed also on baremetal in the unlikely event that
misc_register(&mce_chrdev_device) fails there too.

I was unsure whether to rush it in now and decided to delay it to 3.17.
However, xen people wanted it promoted as it breaks xen when doing cpu
hotplug there. So, after a bit of simmering in tip/master for initial
smoke testing, let's move it to 3.16. It fixes a semi-regression which
got introduced in 3.16 so no need for stable tagging.

tip/x86/ras contains that exact same commit but we can't remove it
there as it is not the last one. It won't cause any merge issues, as I
confirmed locally but I should state here the special situation of this
one fix explicitly anyway.

Thanks.

Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

Changed files
+6 -4
arch
x86
kernel
cpu
mcheck
+6 -4
arch/x86/kernel/cpu/mcheck/mce.c
··· 2451 2451 for_each_online_cpu(i) { 2452 2452 err = mce_device_create(i); 2453 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 2460 cpu_notifier_register_done(); 2455 2461 goto err_device_create; 2456 2462 } ··· 2476 2470 2477 2471 err_register: 2478 2472 unregister_syscore_ops(&mce_syscore_ops); 2479 - 2480 - cpu_notifier_register_begin(); 2481 - __unregister_hotcpu_notifier(&mce_cpu_notifier); 2482 - cpu_notifier_register_done(); 2483 2473 2484 2474 err_device_create: 2485 2475 /*