Skip to contentSkip to conversation

gpio/mxc: make irqs work for fsl,imx21-gpio devices

PATCH New Uwe Kleine-König 5 participants 7 messages Jun 6, 2012 – Jul 5, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

The chained handler was set for the platform device with id == 0. When the gpio devices are instantiated by a device tree, all have id == -1 and so the handler was unset resulting in unusable gpio irqs on i.MX21 and i.MX27 (when using oftree).

---
Hello,

I'm not sure this is material for stable because it never worked before.

Best regards
Uwe

 drivers/gpio/gpio-mxc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-mxc.c +6 -4
index e791476..5c42daf 100644
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
 	writel(~0, port->base + GPIO_ISR);
 
 	if (mxc_gpio_hwtype == IMX21_GPIO) {
-		/* setup one handler for all GPIO interrupts */
-		if (pdev->id == 0)
-			irq_set_chained_handler(port->irq,
-						mx2_gpio_irq_handler);
+		/*
+		 * Setup one handler for all GPIO interrupts. Actually setting
+		 * the handler is needed only once, but doing it for every port
+		 * is more robust and easier.
+		 */
+		irq_set_chained_handler(port->irq, mx2_gpio_irq_handler);
 	} else {
 		/* setup one handler for each entry */
 		irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);
Signature · 1 line
1.7.10
#1 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

Quoted 8 lines · Uwe Kleine-K?nig

The chained handler was set for the platform device with id == 0. When the gpio devices are instantiated by a device tree, all have id == -1 and so the handler was unset resulting in unusable gpio irqs on i.MX21 and i.MX27 (when using oftree).

Hi Uwe,

Thanks for fixing this up.

Regards,
Shawn

Quoted 35 lines

---
Hello,

I'm not sure this is material for stable because it never worked before.

Best regards
Uwe

 drivers/gpio/gpio-mxc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-mxc.c +6 -4
index e791476..5c42daf 100644
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
 	writel(~0, port->base + GPIO_ISR);
 
 	if (mxc_gpio_hwtype == IMX21_GPIO) {
-		/* setup one handler for all GPIO interrupts */
-		if (pdev->id == 0)
-			irq_set_chained_handler(port->irq,
-						mx2_gpio_irq_handler);
+		/*
+		 * Setup one handler for all GPIO interrupts. Actually setting
+		 * the handler is needed only once, but doing it for every port
+		 * is more robust and easier.
+		 */
+		irq_set_chained_handler(port->irq, mx2_gpio_irq_handler);
 	} else {
 		/* setup one handler for each entry */
 		irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);
Signature · 1 line
1.7.10
maintainer
#2 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

In reply to Uwe Kleine-König

[Added Linus to Cc]

Has this been applied? Linus, it seems you handle gpio patches now, you probably missed it because you haven't been on Cc.

Sascha

Quoted 44 lines · Uwe Kleine-K?nig

The chained handler was set for the platform device with id == 0. When the gpio devices are instantiated by a device tree, all have id == -1 and so the handler was unset resulting in unusable gpio irqs on i.MX21 and i.MX27 (when using oftree).

---
Hello,

I'm not sure this is material for stable because it never worked before.

Best regards
Uwe

 drivers/gpio/gpio-mxc.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/gpio/gpio-mxc.c +6 -4
index e791476..5c42daf 100644
@@ -398,10 +398,12 @@ static int __devinit mxc_gpio_probe(struct platform_device *pdev)
 	writel(~0, port->base + GPIO_ISR);
 
 	if (mxc_gpio_hwtype == IMX21_GPIO) {
-		/* setup one handler for all GPIO interrupts */
-		if (pdev->id == 0)
-			irq_set_chained_handler(port->irq,
-						mx2_gpio_irq_handler);
+		/*
+		 * Setup one handler for all GPIO interrupts. Actually setting
+		 * the handler is needed only once, but doing it for every port
+		 * is more robust and easier.
+		 */
+		irq_set_chained_handler(port->irq, mx2_gpio_irq_handler);
 	} else {
 		/* setup one handler for each entry */
 		irq_set_chained_handler(port->irq, mx3_gpio_irq_handler);
Signature · 1 line
1.7.10
Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#3 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

Quoted 4 lines · Sascha Hauer

[Added Linus to Cc]

Has this been applied? Linus, it seems you handle gpio patches now, you probably missed it because you haven't been on Cc.

No I don't, sorry. I try to help Grant with review but I haven't taken over any trees or merging. If I did I would only have to funnel it to Grant anyway.

Yours,
Linus Walleij

#4 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

Quoted 10 lines · Linus Walleij
Quoted 5 lines · Sascha Hauer

[Added Linus to Cc]

Has this been applied? Linus, it seems you handle gpio patches now, you probably missed it because you haven't been on Cc.

No I don't, sorry. I try to help Grant with review but I haven't taken over any trees or merging. If I did I would only have to funnel it to Grant anyway.

Famous last words, I wasn't in sync with my mail log and Grant did ask me to do that...

But now I need to set up a GPIO tree and funnel it to linux-next first.

Yours,
Linus Walleij

maintainer
#5 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

Quoted 9 lines · Linus Walleij
Quoted 7 lines · Linus Walleij
Quoted 5 lines · Sascha Hauer

[Added Linus to Cc]

Has this been applied? Linus, it seems you handle gpio patches now, you probably missed it because you haven't been on Cc.

Quoted 6 lines
Quoted 3 lines

No I don't, sorry. I try to help Grant with review but I haven't taken over any trees or merging. If I did I would only have to funnel it to Grant anyway.

Famous last words, I wasn't in sync with my mail log and Grant did ask me to do that...

nice ;)

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
#6 lore raw

PATCH 1/1 gpio/mxc: make irqs work for fsl,imx21-gpio devices

In reply to Uwe Kleine-König
Quoted 8 lines · Uwe Kleine-K?nig

The chained handler was set for the platform device with id == 0. When the gpio devices are instantiated by a device tree, all have id == -1 and so the handler was unset resulting in unusable gpio irqs on i.MX21 and i.MX27 (when using oftree).

Applied.

Quoted 1 line

I'm not sure this is material for stable because it never worked before.

Why take a chance. It goes to stable.

I'll have to explain to Torvalds why this is coming late.

Yours,
Linus Walleij