• Thomas Gleixner's avatar
    genirq: Handle force threading of irqs with primary and thread handler · 2a1d3ab8
    Thomas Gleixner authored
    Force threading of interrupts does not really deal with interrupts
    which are requested with a primary and a threaded handler. The current
    policy is to leave them alone and let the primary handler run in
    interrupt context, but we set the ONESHOT flag for those interrupts as
    well.
    
    Kohji Okuno debugged a problem with the SDHCI driver where the
    interrupt thread waits for a hardware interrupt to trigger, which can't
    work well because the hardware interrupt is masked due to the ONESHOT
    flag being set. He proposed to set the ONESHOT flag only if the
    interrupt does not provide a thread handler.
    
    Though that does not work either because these interrupts can be
    shared. So the other interrupt would rightfully get the ONESHOT flag
    set and therefor the same situation would happen again.
    
    To deal with this proper, we need to force thread the primary handler
    of such interrupts as well. That means that the primary interrupt
    handler is treated as any other primary interrupt handler which is not
    marked IRQF_NO_THREAD. The threaded handler becomes a separate thread
    so the SDHCI flow logic can be handled gracefully.
    
    The same issue was reported against 4.1-rt.
    Reported-and-tested-by: default avatarKohji Okuno <okuno.kohji@jp.panasonic.com>
    Reported-By: default avatarMichal Smucr <msmucr@gmail.com>
    Reported-and-tested-by: default avatarNathan Sullivan <nathan.sullivan@ni.com>
    Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
    Link: http://lkml.kernel.org/r/alpine.DEB.2.11.1509211058080.5606@nanosSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
    2a1d3ab8
manage.c 51.7 KB