* [PATCH] gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts
@ 2011-07-08 9:02 Alan Cox
2011-07-08 15:33 ` Grant Likely
0 siblings, 1 reply; 2+ messages in thread
From: Alan Cox @ 2011-07-08 9:02 UTC (permalink / raw)
To: grant.likely, torvalds, linux-kernel
From: Mathias Nyman <mathias.nyman@linux.intel.com>
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 <mathias.nyman@linux.intel.com>
Signed-off-by: Alan Cox <alan@linux.intel.com>
---
drivers/gpio/langwell_gpio.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
index bd6571e..644ba12 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 */
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts
2011-07-08 9:02 [PATCH] gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts Alan Cox
@ 2011-07-08 15:33 ` Grant Likely
0 siblings, 0 replies; 2+ messages in thread
From: Grant Likely @ 2011-07-08 15:33 UTC (permalink / raw)
To: Alan Cox; +Cc: torvalds, linux-kernel
On Fri, Jul 08, 2011 at 10:02:18AM +0100, Alan Cox wrote:
> From: Mathias Nyman <mathias.nyman@linux.intel.com>
>
> 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 <mathias.nyman@linux.intel.com>
> Signed-off-by: Alan Cox <alan@linux.intel.com>
Merged, thanks.
g.
> ---
>
> drivers/gpio/langwell_gpio.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
>
> diff --git a/drivers/gpio/langwell_gpio.c b/drivers/gpio/langwell_gpio.c
> index bd6571e..644ba12 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 */
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-07-08 15:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-08 9:02 [PATCH] gpio: langwell_gpio: ack the correct bit for langwell gpio interrupts Alan Cox
2011-07-08 15:33 ` Grant Likely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).