Skip to contentSkip to conversation

gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts

PATCH Applied Alan Cox 2 participants 2 messages Jul 8, 2011 GPIO

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

PATCH 1/1 gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts

From: Mathias Nyman <[email protected]>

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

---

 drivers/gpio/langwell_gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/langwell_gpio.c +1 -1
index bd6571e..644ba12 100644
@@ -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 */
Applied
#1 lore raw
Quoted 7 lines · Alan Cox

From: Mathias Nyman <[email protected]>

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)

Quoted 6 lines

This fixes langwell based devices from hanging when a gpio interrupt is triggered and undoes the breakage which occurred in change set 732063b92bb727b27e61580ce278dddefe31c6ad

Merged, thanks.

g.

Quoted 20 lines

---

 drivers/gpio/langwell_gpio.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/gpio/langwell_gpio.c +1 -1
index bd6571e..644ba12 100644
@@ -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 */