Re: [PATCH] gpio: add interrupt handling capability to max732x

From: Andrew Morton
Date: Fri Mar 19 2010 - 19:42:16 EST


On Tue, 16 Mar 2010 11:34:52 +0100
Marc Zyngier <maz@xxxxxxxxxxxxxxx> wrote:

> +static irqreturn_t max732x_irq_handler(int irq, void *devid)
> +{
> + struct max732x_chip *chip = devid;
> + uint8_t pending;
> + uint8_t level;
> +
> + pending = max732x_irq_pending(chip);
> +
> + if (!pending)
> + return IRQ_HANDLED;

Should be IRQ_NONE?

If this device was on a shared interrupt line and the interrupt was
caused by some other device, and this handler is called first then the
incorrect IRQ_HANDLED return could cause the irq core to do wrong things.


> + do {
> + level = __ffs(pending);
> + handle_nested_irq(level + chip->irq_base);
> +
> + pending &= ~(1 << level);
> + } while (pending);
> +
> + return IRQ_HANDLED;
> +}
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/