From: Ralph Walden Date: Mon, 5 Sep 2005 07:46:34 +0000 (+0300) Subject: [PATCH] ARM: OMAP: Add a loop to test for GPIO interrupts X-Git-Tag: v2.6.13-omap1~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=743daad9f59cc5a67951d5e11b3efada943a7494;p=linux-2.6-omap-h63xx.git [PATCH] ARM: OMAP: Add a loop to test for GPIO interrupts On some OMAPs GPIO interrupts can be lost withouth this loop. This patch was originally suggested by Ladislav Michl. --- diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index c4fb50ed5ed..2a53e090f8e 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -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)