Skip to content

Commit e716efd

Browse files
committed
genirq: Avoid deadlock in spurious handling
commit 52553dd(genirq: fix regression in irqfixup, irqpoll) introduced a potential deadlock by calling the action handler with the irq descriptor lock held. Remove the call and let the handling code run even for an interrupt where only a single action is registered. That matches the goal of the above commit and avoids the deadlock. Document the confusing action = desc->action reload in the handling loop while at it. Reported-and-tested-by: "Wang, Warner" <warner.wang@hp.com> Tested-by: Edward Donovan <edward.donovan@numble.net> Cc: "Wang, Song-Bo (Stoney)" <song-bo.wang@hp.com> Cc: stable@vger.kernel.org Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
1 parent 04aa530 commit e716efd

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎kernel/irq/spurious.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,11 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
8080

8181
/*
8282
* All handlers must agree on IRQF_SHARED, so we test just the
83-
* first. Check for action->next as well.
83+
* first.
8484
*/
8585
action = desc->action;
8686
if (!action || !(action->flags & IRQF_SHARED) ||
87-
(action->flags & __IRQF_TIMER) ||
88-
(action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
89-
!action->next)
87+
(action->flags & __IRQF_TIMER))
9088
goto out;
9189

9290
/* Already running on another processor */
@@ -104,6 +102,7 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)
104102
do {
105103
if (handle_irq_event(desc) == IRQ_HANDLED)
106104
ret = IRQ_HANDLED;
105+
/* Make sure that there is still a valid action */
107106
action = desc->action;
108107
} while ((desc->istate & IRQS_PENDING) && action);
109108
desc->istate &= ~IRQS_POLL_INPROGRESS;

0 commit comments

Comments
 (0)