From 743daad9f59cc5a67951d5e11b3efada943a7494 Mon Sep 17 00:00:00 2001 From: Ralph Walden Date: Mon, 5 Sep 2005 10:46:34 +0300 Subject: [PATCH] [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. --- arch/arm/plat-omap/gpio.c | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) 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) -- 2.41.1