Skip to content

Commit

Permalink
genirq: Avoid deadlock in spurious handling
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Thomas Gleixner committed Dec 11, 2012
1 parent 04aa530 commit e716efd
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel/irq/spurious.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ static int try_one_irq(int irq, struct irq_desc *desc, bool force)

/*
* All handlers must agree on IRQF_SHARED, so we test just the
* first. Check for action->next as well.
* first.
*/
action = desc->action;
if (!action || !(action->flags & IRQF_SHARED) ||
(action->flags & __IRQF_TIMER) ||
(action->handler(irq, action->dev_id) == IRQ_HANDLED) ||
!action->next)
(action->flags & __IRQF_TIMER))
goto out;

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

0 comments on commit e716efd

Please sign in to comment.