From: Mathias Nyman Date: Fri, 8 Jul 2011 09:02:18 +0000 (+0100) Subject: gpio/langwell_gpio: ack the correct bit for langwell gpio interrupts X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=2345b20fd9160d99f7cdf34e7b028ea351bf9c25;p=~shefty%2Frdma-dev.git gpio/langwell_gpio: ack the correct bit for langwell gpio interrupts The wrong bit was masked when acking langwell gpio interrupts. Reason for maskig the wrong bit was probably because__ffs() and ffs() functions return bit indexes differently (0..31 vs 1..32) This fixes langwell based devices from hanging when a gpio interrupt is triggered and undoes the breakage which occurred in change set 732063b92bb727b27e61580ce278dddefe31c6ad Signed-off-by: Mathias Nyman Signed-off-by: Alan Cox Signed-off-by: Grant Likely --- diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c index bd6571e0097..644ba1255d3 100644 --- a/drivers/gpio/langwell_gpio.c +++ b/drivers/gpio/langwell_gpio.c @@ -223,7 +223,7 @@ static void lnw_irq_handler(unsigned irq, struct irq_desc *desc) gedr = gpio_reg(&lnw->chip, base, GEDR); pending = readl(gedr); while (pending) { - gpio = __ffs(pending) - 1; + gpio = __ffs(pending); mask = BIT(gpio); pending &= ~mask; /* Clear before handling so we can't lose an edge */