[PATCHv2 02/10] ARM: vic: MULTI_IRQ_HANDLER handler

Linus Walleij linus.walleij at linaro.org
Fri Nov 4 00:00:15 EST 2011


On Thu, Nov 3, 2011 at 1:51 PM, Russell King - ARM Linux
<linux at arm.linux.org.uk> wrote:

>        stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
>        while (stat) {
>                while (stat) {
>                        irq = ffs(stat) - 1;
>                        stat &= ~(1 << irq);
>                        handle_irq(irq);
>                }
>                stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
>        }
>
> This ensures that we process all interrupts found pending before we
> re-check for any new interrupts pending.  Arguably this is a much
> fairer implementation (and may mean if things get irrevokably stuck,
> things like sysrq via the console uart may still work.)

I really like the looks of this, Jamie can you do it like that?

Maybe some smallish comment about what's going on can be
good for future generations reading that code...

Yours,
Linus Walleij


More information about the devicetree-discuss mailing list