• Hidetoshi Seto's avatar
    x86: MCE: make cmci_discover_lock irq-safe · e5299926
    Hidetoshi Seto authored
    Lockdep reports the warning below when Li tries to offline one cpu:
    
    [  110.835487] =================================
    [  110.835616] [ INFO: inconsistent lock state ]
    [  110.835688] 2.6.30-rc4-00336-g8c9ed899 #52
    [  110.835757] ---------------------------------
    [  110.835828] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage.
    [  110.835908] swapper/0 [HC1[1]:SC0[0]:HE0:SE1] takes:
    [  110.835982]  (cmci_discover_lock){?.+...}, at: [<ffffffff80236dc0>] cmci_clear+0x30/0x9b
    
    cmci_clear() can be called via smp_call_function_single().
    
    It is better to disable interrupt while holding cmci_discover_lock,
    to turn it into an irq-safe lock - we can deadlock otherwise.
    
    [ Impact: fix possible deadlock in the MCE code ]
    Reported-by: default avatarShaohua Li <shaohua.li@intel.com>
    Signed-off-by: default avatarHidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
    Cc: Andi Kleen <andi@firstfloor.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    LKML-Reference: <4A03ED38.8000700@jp.fujitsu.com>
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Reported-by: Shaohua Li<shaohua.li@intel.com>
    e5299926
mce_intel_64.c 7.04 KB