Skip to contentSkip to conversation

pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping

PATCH In review Hans de Goede 5 participants 7 messages Jan 4, 2022 – Jan 16, 2022

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

PATCH 1/1 pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

Fixes bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused")
Reported-and-tested-by Jarkko Nikula <[email protected]>
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pinctrl/intel/pinctrl-cherryview.c +3 -2
index 683b95e9639a..5d85ef5d5da8 100644
@@ -1471,8 +1471,9 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
 
 		offset = cctx->intr_lines[intr_line];
 		if (offset == CHV_INVALID_HWIRQ) {
-			dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line);
-			continue;
+			dev_warn_once(dev, "interrupt on unmapped interrupt line %u\n", intr_line);
+			/* Some boards expect hwirq 0 to trigger in this case */
+			offset = 0;
 		}
 
 		generic_handle_domain_irq(gc->irq.domain, offset);
Signature · 1 line
2.33.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 5 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

Quoted 7 lines

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

Fixes bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused")
Reported-and-tested-by Jarkko Nikula <[email protected]>
Acked-by on v1 1/1
#2 lore raw
In reply to Hans de Goede
Quoted 8 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

Linus, can you apply this directly for v5.16 release?

Quoted 26 lines
Fixes bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused")
Reported-and-tested-by Jarkko Nikula <[email protected]>
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/pinctrl/intel/pinctrl-cherryview.c +3 -2
index 683b95e9639a..5d85ef5d5da8 100644
@@ -1471,8 +1471,9 @@ static void chv_gpio_irq_handler(struct irq_desc *desc)
 
 		offset = cctx->intr_lines[intr_line];
 		if (offset == CHV_INVALID_HWIRQ) {
-			dev_err(dev, "interrupt on unused interrupt line %u\n", intr_line);
-			continue;
+			dev_warn_once(dev, "interrupt on unmapped interrupt line %u\n", intr_line);
+			/* Some boards expect hwirq 0 to trigger in this case */
+			offset = 0;
 		}
 
 		generic_handle_domain_irq(gc->irq.domain, offset);
Signature · 1 line
2.33.1
Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw
Quoted 6 lines · Andy Shevchenko
Quoted 5 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

Quoted 7 lines
Quoted 3 lines

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

Linus, can you apply this directly for v5.16 release?

Unfortunately I am a bit snowed under by backlog but I have now applied it for fixes for v5.17.

Should I now also tag it for stable?

Yours,
Linus Walleij

#4 lore raw

Hi,

Quoted 13 lines · Linus Walleij
Quoted 10 lines · Andy Shevchenko
Quoted 8 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

Quoted 6 lines
Quoted 3 lines

Linus, can you apply this directly for v5.16 release?

Unfortunately I am a bit snowed under by backlog but I have now applied it for fixes for v5.17.

Thank you.

Quoted 1 line

Should I now also tag it for stable?

The troublesome commit this fixes / worksaround is only in Torvald's current master, not in the v5.16 tag, so there is no need for this to go stable.

Regards,

Hans

#5 lore raw
In reply to Hans de Goede
Quoted 8 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

I conducted a research and, on the board Jarkko has issues with, all mentioned pins are floating.

[    3.556875] cherryview-pinctrl INT33FF:00: interrupt on unmapped interrupt line 0

(I believe this matches to 76 below)

[   37.287821] cherryview-pinctrl INT33FF:03: using interrupt line 0 for pin 81
[   37.371456] cherryview-pinctrl INT33FF:02: using interrupt line 0 for pin 22
[   37.389548] cherryview-pinctrl INT33FF:03: using interrupt line 2 for pin 77
[   37.407050] cherryview-pinctrl INT33FF:00: using interrupt line 0 for pin 76

Two of them are designated for SD card and Audio Daughter board. But in all cases is seems like PCB error, unfortunately.

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#6 lore raw

Hi,

Quoted 16 lines · Andy Shevchenko
Quoted 8 lines · Hans de Goede

Commit bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused") made the code properly differentiate between unset vs (hwirq) 0 entries in the GPIO-controller interrupt-line to GPIO pinnumber/hwirq mapping.

This is causing some boards to not boot. This commit restores the old behavior of triggering hwirq 0 when receiving an interrupt on an interrupt-line for which there is no mapping.

I conducted a research and, on the board Jarkko has issues with, all mentioned pins are floating.

[    3.556875] cherryview-pinctrl INT33FF:00: interrupt on unmapped interrupt line 0

(I believe this matches to 76 below)

Quoted 7 lines
[   37.287821] cherryview-pinctrl INT33FF:03: using interrupt line 0 for pin 81
[   37.371456] cherryview-pinctrl INT33FF:02: using interrupt line 0 for pin 22
[   37.389548] cherryview-pinctrl INT33FF:03: using interrupt line 2 for pin 77
[   37.407050] cherryview-pinctrl INT33FF:00: using interrupt line 0 for pin 76

Two of them are designated for SD card and Audio Daughter board. But in all cases is seems like PCB error, unfortunately.

Ok, thank you for looking into this.

Regards,

Hans