Thread (7 messages) 7 messages, 5 authors, 2011-09-29

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

From: Linus Walleij <hidden>
Date: 2011-09-28 11:09:48
Also in: linux-arm-kernel

Possibly related (same subject, not in this thread)

On Wed, Sep 28, 2011 at 12:41 PM, Jamie Iles [off-list ref] wrote:
+static void vic_single_handle_irq(struct vic_device *vic, struct pt_regs *regs)
+{
+       u32 stat, irq;
+       bool handled = false;
+
+       while (!handled) {
+               stat = readl_relaxed(vic->base + VIC_IRQ_STATUS);
+               if (!stat)
+                       break;
+
+               while (stat) {
+                       irq = fls(stat) - 1;
Isn't fls "find last set"?

That means IRQs with higher numbers will be handled first will it not?

For U300 IRQs with lower numbers will be handled first
by iteratively testing bit 0 and shifting right:

-1002:  tst     \irqstat, #1
-       bne     1003f
-       add     \irqnr, \irqnr, #1
-       movs    \irqstat, \irqstat, lsr #1
-       bne     1002b

So I would use ffs() for this to work the same way as before in
U300.

Since this can have some performance impact, if the platforms differ
in whether they handle IRQs from low to high or from high to low
might need to be a flag passed in to vic_init() or so...

Yours,
Linus Walleij
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help