Skip to content

Commit

Permalink
ns9xxx: fix handle_prio_irq to unmask irqs with lower priority
Browse files Browse the repository at this point in the history
When an irq is reported all lower prio irqs are masked until the current
irq is acked.  So never leave handle_prio_irq without acking.

desc->status & IRQ_INPROGRESS should never become true because the current
irq is masked until it is acked, too.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
  • Loading branch information
Uwe Kleine-König authored and Uwe Kleine-König committed Apr 25, 2008
1 parent 5e69b94 commit a13c819
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions arch/arm/mach-ns9xxx/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,14 @@ void handle_prio_irq(unsigned int irq, struct irq_desc *desc)

spin_lock(&desc->lock);

if (unlikely(desc->status & IRQ_INPROGRESS))
goto out_unlock;
BUG_ON(desc->status & IRQ_INPROGRESS);

desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
kstat_cpu(cpu).irqs[irq]++;

action = desc->action;
if (unlikely(!action || (desc->status & IRQ_DISABLED)))
goto out_unlock;
goto out_mask;

desc->status |= IRQ_INPROGRESS;
spin_unlock(&desc->lock);
Expand All @@ -81,10 +80,14 @@ void handle_prio_irq(unsigned int irq, struct irq_desc *desc)

spin_lock(&desc->lock);
desc->status &= ~IRQ_INPROGRESS;
if (!(desc->status & IRQ_DISABLED) && desc->chip->ack)
desc->chip->ack(irq);

out_unlock:
if (desc->status & IRQ_DISABLED)
out_mask:
desc->chip->mask(irq);

/* ack unconditionally to unmask lower prio irqs */
desc->chip->ack(irq);

spin_unlock(&desc->lock);
}
#define handle_irq handle_prio_irq
Expand Down

0 comments on commit a13c819

Please sign in to comment.