linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
@ 2015-04-23 23:54 Tony Lindgren
  2015-04-24 14:58 ` Grygorii.Strashko@linaro.org
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Tony Lindgren @ 2015-04-23 23:54 UTC (permalink / raw)
  To: linux-arm-kernel

At some point with all the GPIO clean-up we've broken the
MPUIO interrupts. Those are just a little bit different from
the GPIO interrupts, so we can fix it up just by setting
different irqchip functions for it. And then we can just
remove all old code trying to do the same.

Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Nishanth Menon <nm@ti.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 drivers/gpio/gpio-omap.c | 48 +++++++++---------------------------------------
 1 file changed, 9 insertions(+), 39 deletions(-)

diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 6553361..b59c3ca 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1023,38 +1023,8 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
 		dev_err(bank->dev, "Could not get gpio dbck\n");
 }
 
-static void
-omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
-		    unsigned int num)
-{
-	struct irq_chip_generic *gc;
-	struct irq_chip_type *ct;
-
-	gc = irq_alloc_generic_chip("MPUIO", 1, irq_start, bank->base,
-				    handle_simple_irq);
-	if (!gc) {
-		dev_err(bank->dev, "Memory alloc failed for gc\n");
-		return;
-	}
-
-	ct = gc->chip_types;
-
-	/* NOTE: No ack required, reading IRQ status clears it. */
-	ct->chip.irq_mask = irq_gc_mask_set_bit;
-	ct->chip.irq_unmask = irq_gc_mask_clr_bit;
-	ct->chip.irq_set_type = omap_gpio_irq_type;
-
-	if (bank->regs->wkup_en)
-		ct->chip.irq_set_wake = omap_gpio_wake_enable;
-
-	ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
-	irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
-			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
-}
-
 static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
 {
-	int j;
 	static int gpio;
 	int irq_base = 0;
 	int ret;
@@ -1101,6 +1071,15 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
 	}
 #endif
 
+	/* MPUIO is a bit different, reading IRQ status clears it */
+	if (bank->is_mpuio) {
+		irqc->irq_ack = dummy_irq_chip.irq_ack;
+		irqc->irq_mask = irq_gc_mask_set_bit;
+		irqc->irq_unmask = irq_gc_mask_clr_bit;
+		if (!bank->regs->wkup_en)
+			irqc->irq_set_wake = NULL;
+	}
+
 	ret = gpiochip_irqchip_add(&bank->chip, irqc,
 				   irq_base, omap_gpio_irq_handler,
 				   IRQ_TYPE_NONE);
@@ -1114,15 +1093,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
 	gpiochip_set_chained_irqchip(&bank->chip, irqc,
 				     bank->irq, omap_gpio_irq_handler);
 
-	for (j = 0; j < bank->width; j++) {
-		int irq = irq_find_mapping(bank->chip.irqdomain, j);
-		if (bank->is_mpuio) {
-			omap_mpuio_alloc_gc(bank, irq, bank->width);
-			irq_set_chip_and_handler(irq, NULL, NULL);
-			set_irq_flags(irq, 0);
-		}
-	}
-
 	return 0;
 }
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
  2015-04-23 23:54 [PATCH] gpio: omap: Fix regression for MPUIO interrupts Tony Lindgren
@ 2015-04-24 14:58 ` Grygorii.Strashko@linaro.org
  2015-04-24 15:29 ` santosh shilimkar
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Grygorii.Strashko@linaro.org @ 2015-04-24 14:58 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/24/2015 02:54 AM, Tony Lindgren wrote:
> At some point with all the GPIO clean-up we've broken the
> MPUIO interrupts. Those are just a little bit different from
> the GPIO interrupts, so we can fix it up just by setting
> different irqchip functions for it. And then we can just
> remove all old code trying to do the same.

Reviewed-by: Grygorii Strashko <grygorii.strashko@linaro.org>

>
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
>   drivers/gpio/gpio-omap.c | 48 +++++++++---------------------------------------
>   1 file changed, 9 insertions(+), 39 deletions(-)
>
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 6553361..b59c3ca 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1023,38 +1023,8 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
>   		dev_err(bank->dev, "Could not get gpio dbck\n");
>   }
>
> -static void
> -omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
> -		    unsigned int num)
> -{
> -	struct irq_chip_generic *gc;
> -	struct irq_chip_type *ct;
> -
> -	gc = irq_alloc_generic_chip("MPUIO", 1, irq_start, bank->base,
> -				    handle_simple_irq);
> -	if (!gc) {
> -		dev_err(bank->dev, "Memory alloc failed for gc\n");
> -		return;
> -	}
> -
> -	ct = gc->chip_types;
> -
> -	/* NOTE: No ack required, reading IRQ status clears it. */
> -	ct->chip.irq_mask = irq_gc_mask_set_bit;
> -	ct->chip.irq_unmask = irq_gc_mask_clr_bit;
> -	ct->chip.irq_set_type = omap_gpio_irq_type;
> -
> -	if (bank->regs->wkup_en)
> -		ct->chip.irq_set_wake = omap_gpio_wake_enable;
> -
> -	ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
> -	irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
> -			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
> -}
> -
>   static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   {
> -	int j;
>   	static int gpio;
>   	int irq_base = 0;
>   	int ret;
> @@ -1101,6 +1071,15 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   	}
>   #endif
>
> +	/* MPUIO is a bit different, reading IRQ status clears it */
> +	if (bank->is_mpuio) {
> +		irqc->irq_ack = dummy_irq_chip.irq_ack;
> +		irqc->irq_mask = irq_gc_mask_set_bit;
> +		irqc->irq_unmask = irq_gc_mask_clr_bit;
> +		if (!bank->regs->wkup_en)
> +			irqc->irq_set_wake = NULL;
> +	}
> +
>   	ret = gpiochip_irqchip_add(&bank->chip, irqc,
>   				   irq_base, omap_gpio_irq_handler,
>   				   IRQ_TYPE_NONE);
> @@ -1114,15 +1093,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>   	gpiochip_set_chained_irqchip(&bank->chip, irqc,
>   				     bank->irq, omap_gpio_irq_handler);
>
> -	for (j = 0; j < bank->width; j++) {
> -		int irq = irq_find_mapping(bank->chip.irqdomain, j);
> -		if (bank->is_mpuio) {
> -			omap_mpuio_alloc_gc(bank, irq, bank->width);
> -			irq_set_chip_and_handler(irq, NULL, NULL);
> -			set_irq_flags(irq, 0);
> -		}
> -	}
> -
>   	return 0;
>   }
>
>


-- 
regards,
-grygorii

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
  2015-04-23 23:54 [PATCH] gpio: omap: Fix regression for MPUIO interrupts Tony Lindgren
  2015-04-24 14:58 ` Grygorii.Strashko@linaro.org
@ 2015-04-24 15:29 ` santosh shilimkar
  2015-04-24 16:10 ` Felipe Balbi
  2015-05-06 13:21 ` Linus Walleij
  3 siblings, 0 replies; 6+ messages in thread
From: santosh shilimkar @ 2015-04-24 15:29 UTC (permalink / raw)
  To: linux-arm-kernel

On 4/23/2015 4:54 PM, Tony Lindgren wrote:
> At some point with all the GPIO clean-up we've broken the
> MPUIO interrupts. Those are just a little bit different from
> the GPIO interrupts, so we can fix it up just by setting
> different irqchip functions for it. And then we can just
> remove all old code trying to do the same.
>
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>
> ---
Acked-by: Santosh Shilimkar <ssantosh@kernel.org>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
  2015-04-23 23:54 [PATCH] gpio: omap: Fix regression for MPUIO interrupts Tony Lindgren
  2015-04-24 14:58 ` Grygorii.Strashko@linaro.org
  2015-04-24 15:29 ` santosh shilimkar
@ 2015-04-24 16:10 ` Felipe Balbi
  2015-05-06 13:21 ` Linus Walleij
  3 siblings, 0 replies; 6+ messages in thread
From: Felipe Balbi @ 2015-04-24 16:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Thu, Apr 23, 2015 at 04:54:17PM -0700, Tony Lindgren wrote:
> At some point with all the GPIO clean-up we've broken the
> MPUIO interrupts. Those are just a little bit different from
> the GPIO interrupts, so we can fix it up just by setting
> different irqchip functions for it. And then we can just
> remove all old code trying to do the same.
> 
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Reviewed-by: Felipe Balbi <balbi@ti.com>

> ---
>  drivers/gpio/gpio-omap.c | 48 +++++++++---------------------------------------
>  1 file changed, 9 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
> index 6553361..b59c3ca 100644
> --- a/drivers/gpio/gpio-omap.c
> +++ b/drivers/gpio/gpio-omap.c
> @@ -1023,38 +1023,8 @@ static void omap_gpio_mod_init(struct gpio_bank *bank)
>  		dev_err(bank->dev, "Could not get gpio dbck\n");
>  }
>  
> -static void
> -omap_mpuio_alloc_gc(struct gpio_bank *bank, unsigned int irq_start,
> -		    unsigned int num)
> -{
> -	struct irq_chip_generic *gc;
> -	struct irq_chip_type *ct;
> -
> -	gc = irq_alloc_generic_chip("MPUIO", 1, irq_start, bank->base,
> -				    handle_simple_irq);
> -	if (!gc) {
> -		dev_err(bank->dev, "Memory alloc failed for gc\n");
> -		return;
> -	}
> -
> -	ct = gc->chip_types;
> -
> -	/* NOTE: No ack required, reading IRQ status clears it. */
> -	ct->chip.irq_mask = irq_gc_mask_set_bit;
> -	ct->chip.irq_unmask = irq_gc_mask_clr_bit;
> -	ct->chip.irq_set_type = omap_gpio_irq_type;
> -
> -	if (bank->regs->wkup_en)
> -		ct->chip.irq_set_wake = omap_gpio_wake_enable;
> -
> -	ct->regs.mask = OMAP_MPUIO_GPIO_INT / bank->stride;
> -	irq_setup_generic_chip(gc, IRQ_MSK(num), IRQ_GC_INIT_MASK_CACHE,
> -			       IRQ_NOREQUEST | IRQ_NOPROBE, 0);
> -}
> -
>  static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>  {
> -	int j;
>  	static int gpio;
>  	int irq_base = 0;
>  	int ret;
> @@ -1101,6 +1071,15 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>  	}
>  #endif
>  
> +	/* MPUIO is a bit different, reading IRQ status clears it */
> +	if (bank->is_mpuio) {
> +		irqc->irq_ack = dummy_irq_chip.irq_ack;
> +		irqc->irq_mask = irq_gc_mask_set_bit;
> +		irqc->irq_unmask = irq_gc_mask_clr_bit;
> +		if (!bank->regs->wkup_en)
> +			irqc->irq_set_wake = NULL;
> +	}
> +
>  	ret = gpiochip_irqchip_add(&bank->chip, irqc,
>  				   irq_base, omap_gpio_irq_handler,
>  				   IRQ_TYPE_NONE);
> @@ -1114,15 +1093,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
>  	gpiochip_set_chained_irqchip(&bank->chip, irqc,
>  				     bank->irq, omap_gpio_irq_handler);
>  
> -	for (j = 0; j < bank->width; j++) {
> -		int irq = irq_find_mapping(bank->chip.irqdomain, j);
> -		if (bank->is_mpuio) {
> -			omap_mpuio_alloc_gc(bank, irq, bank->width);
> -			irq_set_chip_and_handler(irq, NULL, NULL);
> -			set_irq_flags(irq, 0);
> -		}
> -	}
> -
>  	return 0;
>  }
>  
> -- 
> 2.1.4
> 

-- 
balbi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20150424/ad5a0d54/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
  2015-04-23 23:54 [PATCH] gpio: omap: Fix regression for MPUIO interrupts Tony Lindgren
                   ` (2 preceding siblings ...)
  2015-04-24 16:10 ` Felipe Balbi
@ 2015-05-06 13:21 ` Linus Walleij
  2015-05-06 15:36   ` Tony Lindgren
  3 siblings, 1 reply; 6+ messages in thread
From: Linus Walleij @ 2015-05-06 13:21 UTC (permalink / raw)
  To: linux-arm-kernel

On Fri, Apr 24, 2015 at 1:54 AM, Tony Lindgren <tony@atomide.com> wrote:

> At some point with all the GPIO clean-up we've broken the
> MPUIO interrupts. Those are just a little bit different from
> the GPIO interrupts, so we can fix it up just by setting
> different irqchip functions for it. And then we can just
> remove all old code trying to do the same.
>
> Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Javier Martinez Canillas <javier@dowhile0.org>
> Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
> Cc: Kevin Hilman <khilman@deeprootsystems.com>
> Cc: Nishanth Menon <nm@ti.com>
> Cc: Santosh Shilimkar <ssantosh@kernel.org>
> Signed-off-by: Tony Lindgren <tony@atomide.com>

Patch applied for fixes with the ACKs etc,

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] gpio: omap: Fix regression for MPUIO interrupts
  2015-05-06 13:21 ` Linus Walleij
@ 2015-05-06 15:36   ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2015-05-06 15:36 UTC (permalink / raw)
  To: linux-arm-kernel

* Linus Walleij <linus.walleij@linaro.org> [150506 06:22]:
> On Fri, Apr 24, 2015 at 1:54 AM, Tony Lindgren <tony@atomide.com> wrote:
> 
> > At some point with all the GPIO clean-up we've broken the
> > MPUIO interrupts. Those are just a little bit different from
> > the GPIO interrupts, so we can fix it up just by setting
> > different irqchip functions for it. And then we can just
> > remove all old code trying to do the same.
> >
> > Cc: Aaro Koskinen <aaro.koskinen@iki.fi>
> > Cc: Felipe Balbi <balbi@ti.com>
> > Cc: Javier Martinez Canillas <javier@dowhile0.org>
> > Cc: Grygorii Strashko <grygorii.strashko@linaro.org>
> > Cc: Kevin Hilman <khilman@deeprootsystems.com>
> > Cc: Nishanth Menon <nm@ti.com>
> > Cc: Santosh Shilimkar <ssantosh@kernel.org>
> > Signed-off-by: Tony Lindgren <tony@atomide.com>
> 
> Patch applied for fixes with the ACKs etc,

Thanks. Yes this should go in during the -rc cycle as a regresion
fix. Sorry I could not exactly pinpoint where we've broken the
MPUIO interrupts with all the clean-up.

Also the omap1 SPARSE_IRQ changes I recently posted have a
dependency to this one so that's another reason to get this
one out of the way.

No rush with the other ones, those should be OK for v4.2.

Regards,

Tony

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-05-06 15:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-23 23:54 [PATCH] gpio: omap: Fix regression for MPUIO interrupts Tony Lindgren
2015-04-24 14:58 ` Grygorii.Strashko@linaro.org
2015-04-24 15:29 ` santosh shilimkar
2015-04-24 16:10 ` Felipe Balbi
2015-05-06 13:21 ` Linus Walleij
2015-05-06 15:36   ` Tony Lindgren

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).