Skip to content

Commit

Permalink
pinctrl-bcm2708: don't call handler for disabled IRQs
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Arlott <sa.me.uk>
  • Loading branch information
nomis committed Jun 16, 2012
1 parent ba9ce42 commit 8953f26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/pinctrl/pinctrl-bcm2708.c
Expand Up @@ -409,20 +409,24 @@ static irqreturn_t bcm2708_gpio_irq_handler(int irq, void *dev_id)
unsigned offset;
unsigned gpio;
unsigned int type;
bool enabled;

events = bcm2708_gpio_rd(pc, GPEDS0 + bank * 4);
for_each_set_bit(offset, &events, 32) {
gpio = (32 * bank) + offset;

spin_lock(&pc->irq_lock[bank]);
enabled = test_bit(offset, pc->enabled_irq_map);
type = pc->irq_type[gpio];
spin_unlock(&pc->irq_lock[bank]);

/* ack edge triggered IRQs immediately */
if (!(type & IRQ_TYPE_LEVEL_MASK))
bcm2708_gpio_set_bit(pc, GPEDS0, gpio);

generic_handle_irq(irq_linear_revmap(pc->irq_domain, gpio));
if (enabled)
generic_handle_irq(
irq_linear_revmap(pc->irq_domain, gpio));

/* ack level triggered IRQ after handling them */
if (type & IRQ_TYPE_LEVEL_MASK)
Expand Down

0 comments on commit 8953f26

Please sign in to comment.