• Liu, Chuansheng's avatar
    x86: Preserve lazy irq disable semantics in fixup_irqs() · 99dd5497
    Liu, Chuansheng authored
    The default irq_disable() sematics are to mark the interrupt disabled,
    but keep it unmasked. If the interrupt is delivered while marked
    disabled, the low level interrupt handler masks it and marks it
    pending. This is important for detecting wakeup interrupts during
    suspend and for edge type interrupts to avoid losing interrupts.
    
    fixup_irqs() moves the interrupts away from an offlined cpu. For
    certain interrupt types it needs to mask the interrupt line before
    changing the affinity. After affinity has changed the interrupt line
    is unmasked again, but only if it is not marked disabled.
    
    This breaks the lazy irq disable semantics and causes problems in
    suspend as the interrupt can be lost or wakeup functionality is
    broken.
    
    Check irqd_irq_masked() instead of irqd_irq_disabled() because
    irqd_irq_masked() is only set, when the core code actually masked the
    interrupt line. If it's not set, we unmask the interrupt and let the
    lazy irq disable logic deal with an eventually incoming interrupt.
    
    [ tglx: Massaged changelog and added a comment ]
    Signed-off-by: default avatarliu chuansheng <chuansheng.liu@intel.com>
    Cc: Yanmin Zhang <yanmin_zhang@linux.intel.com>
    Link: http://lkml.kernel.org/r/27240C0AC20F114CBF8149A2696CBE4A05DFB3@SHSMSX101.ccr.corp.intel.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    99dd5497
irq.c 8.67 KB