]> Pileus Git - ~andy/linux/commit
genirq: Flush the irq thread on synchronization
authorIdo Yariv <ido@wizery.com>
Fri, 2 Dec 2011 16:24:12 +0000 (18:24 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Wed, 14 Mar 2012 10:56:20 +0000 (11:56 +0100)
commit7140ea1980f2fae9c7aaeac5f6b35317e1389ee6
tree7b1021c74dee94b0171db25bc1965555e0e9a9e5
parentdf8d291f28aa1e8437c8f7816328a6516379c71b
genirq: Flush the irq thread on synchronization

The current implementation does not always flush the threaded handler
when disabling the irq. In case the irq handler was called, but the
threaded handler hasn't started running yet, the interrupt will be
flagged as pending, and the handler will not run. This implementation
has some issues:

First, if the interrupt is a wake source and flagged as pending, the
system will not be able to suspend.

Second, when quickly disabling and re-enabling the irq, the threaded
handler might continue to run after the irq is re-enabled without the
irq handler being called first. This might be an unexpected behavior.

In addition, it might be counter-intuitive that the threaded handler
will not be called even though the irq handler was called and returned
IRQ_WAKE_THREAD.

Fix this by always waiting for the threaded handler to complete in
synchronize_irq().

[ tglx: Massaged comments, added WARN_ONs and the missing
   IRQTF_RUNTHREAD check in exit_irq_thread() ]

Signed-off-by: Ido Yariv <ido@wizery.com>
Link: http://lkml.kernel.org/r/1322843052-7166-1-git-send-email-ido@wizery.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
kernel/irq/handle.c
kernel/irq/manage.c