]> git.baikalelectronics.ru Git - kernel.git/commit
genirq: Make force irq threading setup more robust
authorThomas Gleixner <tglx@linutronix.de>
Fri, 3 Aug 2018 12:44:59 +0000 (14:44 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Fri, 3 Aug 2018 13:19:01 +0000 (15:19 +0200)
commit5bcb79f1ee6f6f8739d4da8e4ee295519e64a4c9
tree86c897e94952090eee579ed47f49cc7006c41fd6
parentd6af5f1362331d0eb1e97ed76a0c2cf11f981756
genirq: Make force irq threading setup more robust

The support of force threading interrupts which are set up with both a
primary and a threaded handler wreckaged the setup of regular requested
threaded interrupts (primary handler == NULL).

The reason is that it does not check whether the primary handler is set to
the default handler which wakes the handler thread. Instead it replaces the
thread handler with the primary handler as it would do with force threaded
interrupts which have been requested via request_irq(). So both the primary
and the thread handler become the same which then triggers the warnon that
the thread handler tries to wakeup a not configured secondary thread.

Fortunately this only happens when the driver omits the IRQF_ONESHOT flag
when requesting the threaded interrupt, which is normaly caught by the
sanity checks when force irq threading is disabled.

Fix it by skipping the force threading setup when a regular threaded
interrupt is requested. As a consequence the interrupt request which lacks
the IRQ_ONESHOT flag is rejected correctly instead of silently wreckaging
it.

Fixes: a118951f1d59 ("genirq: Handle force threading of irqs with primary and thread handler")
Reported-by: Kurt Kanzenbach <kurt.kanzenbach@linutronix.de>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Tested-by: Kurt Kanzenbach <kurt.kanzenbach@linutronix.de>
Cc: stable@vger.kernel.org
kernel/irq/manage.c