Messages in this thread | | | Date | Fri, 20 Jun 2014 22:29:00 +0200 | From | Borislav Petkov <> | Subject | Re: [PATCH] x86/mce: Don't unregister CPU hotplug notifier in error path |
| |
On Fri, Jun 20, 2014 at 04:16:50PM -0400, Boris Ostrovsky wrote: > Sorry, mce_device_create(). > > We can't call it in the notifier until mcheck_init_device() has been > successfully executed (we need subsys_system_register(&mce_subsys)). I don't > know whether we can call subsys_system_register() in mcheck_init() -- it is > quite early in the boot.
I don't think it matters: we want to add only this oneliner to mcheck_init():
__register_hotcpu_notifier(&mce_cpu_notifier);
and remove it from mcheck_init_device(), nothing else. And we don't need the synchronization even because we're BSP only then.
I mean, we won't be able to offline CPUs that early anyway - thus call mce_device_create() in the notifier callback - as we don't have userspace to do "echo 0 > ..."
The rest of the code remains and mcheck_init_device() executes when it does. Unless I'm missing something, of course...
Oh, not quite. We probably should remove the
__unregister_hotcpu_notifier(&mce_cpu_notifier);
from the error path too, as you suggest.
When you do, please hold that down in the commit message so that it is clear what we're doing.
-- Regards/Gruss, Boris.
Sent from a fat crate under my desk. Formatting is fine. --
| |