• Andreas Herrmann's avatar
    x86: don't call mce_create_device on CPU_UP_PREPARE · bae19fe0
    Andreas Herrmann authored
    Fix regression introduced with d435d862
    ("cpu hotplug: mce: fix cpu hotplug error handling").
    
    A CPU which was not brought up during boot (using maxcpus and
    additional_cpus parameters) couldn't be onlined anymore.  For such a CPU it
    seemed that MCE was not supported during CPU_UP_PREPARE-time which caused
    mce_cpu_callback to return NOTIFY_BAD to notifier_call_chain.  To fix this
    we:
    
     - call mce_create_device for CPU_ONLINE event (instead of CPU_UP_PREPARE),
     - avoid mce_remove_device() for the CPU that is not correctly initialized
       by mce_create_device() failure,
     - make mce_cpu_callback always return NOTIFY_OK for CPU_ONLINE event.
       Because CPU_ONLINE callback return value is always ignored.
    
    [akinobu.mita@gmail.com: avoid mce_remove_device() for not initialized device]
    [akinobu.mita@gmail.com: make mce_cpu_callback always return NOTIFY_OK]
    Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
    Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    bae19fe0
mce_64.c 21.1 KB