]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] ARM: OMAP: Add a loop to test for GPIO interrupts
authorRalph Walden <ralphw@everest-co.com>
Mon, 5 Sep 2005 07:46:34 +0000 (10:46 +0300)
committerTony Lindgren <tony@atomide.com>
Mon, 5 Sep 2005 07:46:34 +0000 (10:46 +0300)
On some OMAPs GPIO interrupts can be lost withouth this loop.
This patch was originally suggested by Ladislav Michl.

arch/arm/plat-omap/gpio.c

index c4fb50ed5edd2bd3a7ecd61a53b4594e1f55a2f8..2a53e090f8efa80e380ab95ee5e0bdcb5ab81345 100644 (file)
@@ -806,23 +806,25 @@ static void gpio_irq_handler(unsigned int irq, struct irqdesc *desc,
                isr_reg = bank->base + OMAP24XX_GPIO_IRQSTATUS1;
 #endif
 
-       isr = __raw_readl((void __iomem *)isr_reg);
-       _enable_gpio_irqbank(bank, isr, 0);
-       _clear_gpio_irqbank(bank, isr);
-       _enable_gpio_irqbank(bank, isr, 1);
-       desc->chip->unmask(irq);
-
-       if (unlikely(!isr))
-               return;
+       while(1) {
+               isr = __raw_readl((void __iomem *)isr_reg);
+               _enable_gpio_irqbank(bank, isr, 0);
+               _clear_gpio_irqbank(bank, isr);
+               _enable_gpio_irqbank(bank, isr, 1);
+               desc->chip->unmask(irq);
+
+               if (!isr)
+                       break;
 
-       gpio_irq = bank->virtual_irq_start;
-       for (; isr != 0; isr >>= 1, gpio_irq++) {
-               struct irqdesc *d;
-               if (!(isr & 1))
-                       continue;
-               d = irq_desc + gpio_irq;
-               d->handle(gpio_irq, d, regs);
-       }
+               gpio_irq = bank->virtual_irq_start;
+               for (; isr != 0; isr >>= 1, gpio_irq++) {
+                       struct irqdesc *d;
+                       if (!(isr & 1))
+                               continue;
+                       d = irq_desc + gpio_irq;
+                       d->handle(gpio_irq, d, regs);
+               }
+        }
 }
 
 static void gpio_ack_irq(unsigned int irq)