Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1505917 > unrolled thread

gpio: mxs: fix duplicate level interrupts

Started bySascha Hauer <s.hauer@pengutronix.de>
First post2016-10-21 15:20 +0200
Last post2016-10-24 03:00 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  gpio: mxs: fix duplicate level interrupts Sascha Hauer <s.hauer@pengutronix.de> - 2016-10-21 15:20 +0200
    [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs Sascha Hauer <s.hauer@pengutronix.de> - 2016-10-21 15:20 +0200
      Re: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs Marek Vasut <marex@denx.de> - 2016-10-21 20:20 +0200
      Re: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs Linus Walleij <linus.walleij@linaro.org> - 2016-10-24 03:00 +0200

#1505917 — gpio: mxs: fix duplicate level interrupts

FromSascha Hauer <s.hauer@pengutronix.de>
Date2016-10-21 15:20 +0200
Subjectgpio: mxs: fix duplicate level interrupts
Message-ID<suHTP-60l-19@gated-at.bofh.it>
We observed that each level interrupt triggers two interrupts. This
is because the driver erroneously uses the IRQSTAT register to 
acknowledge level interrupts which according to the reference manual
is not possible. Patch 2/2 fixes that, look for its commit message
for a detailed description what happens and how it is fixed.

Sascha

----------------------------------------------------------------
Sascha Hauer (2):
      gpio: mxs: use enable/disable regs to (un)mask irqs
      gpio: mxs: fix duplicate level interrupts

[toc] | [next] | [standalone]


#1505923 — [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs

FromSascha Hauer <s.hauer@pengutronix.de>
Date2016-10-21 15:20 +0200
Subject[PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs
Message-ID<suHTP-60l-29@gated-at.bofh.it>
In reply to#1505917
The mxs gpio controller does not only have a mask register to mask
interrupts, but also enable/disable registers. Use the enable/disable
registers rather than the mask register. This does not have any
advantage for now, but makes the next patch simpler.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
 drivers/gpio/gpio-mxs.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
index b9daa0b..1cf579f 100644
--- a/drivers/gpio/gpio-mxs.c
+++ b/drivers/gpio/gpio-mxs.c
@@ -211,12 +211,13 @@ static int __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
 
 	ct = gc->chip_types;
 	ct->chip.irq_ack = irq_gc_ack_set_bit;
-	ct->chip.irq_mask = irq_gc_mask_clr_bit;
-	ct->chip.irq_unmask = irq_gc_mask_set_bit;
+	ct->chip.irq_mask = irq_gc_mask_disable_reg;
+	ct->chip.irq_unmask = irq_gc_unmask_enable_reg;
 	ct->chip.irq_set_type = mxs_gpio_set_irq_type;
 	ct->chip.irq_set_wake = mxs_gpio_set_wake_irq;
 	ct->regs.ack = PINCTRL_IRQSTAT(port) + MXS_CLR;
-	ct->regs.mask = PINCTRL_IRQEN(port);
+	ct->regs.enable = PINCTRL_IRQEN(port) + MXS_SET;
+	ct->regs.disable = PINCTRL_IRQEN(port) + MXS_CLR;
 
 	irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
 			       IRQ_NOREQUEST, 0);
-- 
2.9.3

[toc] | [prev] | [next] | [standalone]


#1506206 — Re: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs

FromMarek Vasut <marex@denx.de>
Date2016-10-21 20:20 +0200
SubjectRe: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs
Message-ID<suMAa-Sc-15@gated-at.bofh.it>
In reply to#1505923
On 10/21/2016 03:11 PM, Sascha Hauer wrote:
> The mxs gpio controller does not only have a mask register to mask
> interrupts, but also enable/disable registers. Use the enable/disable
> registers rather than the mask register. This does not have any
> advantage for now, but makes the next patch simpler.
> 
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Reviewed-by: Marek Vasut <marex@denx.de>

Thanks

> ---
>  drivers/gpio/gpio-mxs.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-mxs.c b/drivers/gpio/gpio-mxs.c
> index b9daa0b..1cf579f 100644
> --- a/drivers/gpio/gpio-mxs.c
> +++ b/drivers/gpio/gpio-mxs.c
> @@ -211,12 +211,13 @@ static int __init mxs_gpio_init_gc(struct mxs_gpio_port *port, int irq_base)
>  
>  	ct = gc->chip_types;
>  	ct->chip.irq_ack = irq_gc_ack_set_bit;
> -	ct->chip.irq_mask = irq_gc_mask_clr_bit;
> -	ct->chip.irq_unmask = irq_gc_mask_set_bit;
> +	ct->chip.irq_mask = irq_gc_mask_disable_reg;
> +	ct->chip.irq_unmask = irq_gc_unmask_enable_reg;
>  	ct->chip.irq_set_type = mxs_gpio_set_irq_type;
>  	ct->chip.irq_set_wake = mxs_gpio_set_wake_irq;
>  	ct->regs.ack = PINCTRL_IRQSTAT(port) + MXS_CLR;
> -	ct->regs.mask = PINCTRL_IRQEN(port);
> +	ct->regs.enable = PINCTRL_IRQEN(port) + MXS_SET;
> +	ct->regs.disable = PINCTRL_IRQEN(port) + MXS_CLR;
>  
>  	irq_setup_generic_chip(gc, IRQ_MSK(32), IRQ_GC_INIT_NESTED_LOCK,
>  			       IRQ_NOREQUEST, 0);
> 


-- 
Best regards,
Marek Vasut

[toc] | [prev] | [next] | [standalone]


#1506815 — Re: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs

FromLinus Walleij <linus.walleij@linaro.org>
Date2016-10-24 03:00 +0200
SubjectRe: [PATCH 1/2] gpio: mxs: use enable/disable regs to (un)mask irqs
Message-ID<svBMm-eA-13@gated-at.bofh.it>
In reply to#1505923
On Fri, Oct 21, 2016 at 3:11 PM, Sascha Hauer <s.hauer@pengutronix.de> wrote:

> The mxs gpio controller does not only have a mask register to mask
> interrupts, but also enable/disable registers. Use the enable/disable
> registers rather than the mask register. This does not have any
> advantage for now, but makes the next patch simpler.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

Patch applied with Marek's review tag.

Yours,
Linus Walleij

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web