• Bryan Holty's avatar
    [PATCH] IRQ: prevent enabling of previously disabled interrupt · 501f2499
    Bryan Holty authored
    This fix prevents re-disabling and enabling of a previously disabled
    interrupt.  On an SMP system with irq balancing enabled; If an interrupt is
    disabled from within its own interrupt context with disable_irq_nosync and is
    also earmarked for processor migration, the interrupt is blindly moved to the
    other processor and enabled without regard for its current "enabled" state.
    If there is an interrupt pending, it will unexpectedly invoke the irq handler
    on the new irq owning processor (even though the irq was previously disabled)
    
    The more intuitive fix would be to invoke disable_irq_nosync and
    enable_irq, but since we already have the desc->lock from __do_IRQ, we
    cannot call them directly.  Instead we can use the same logic to disable
    and enable found in disable_irq_nosync and enable_irq, with regards to the
    desc->depth.
    
    This now prevents a disabled interrupt from being re-disabled, and more
    importantly prevents a disabled interrupt from being incorrectly enabled on
    a different processor.
    Signed-off-by: default avatarBryan Holty <lgeek@frontiernet.net>
    Cc: Andi Kleen <ak@muc.de>
    Cc: "Luck, Tony" <tony.luck@intel.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    501f2499
migration.c 1.42 KB