Linux GPIO subsystem development
 help / color / mirror / Atom feed
* [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
@ 2022-01-04 16:42 Hans de Goede
  2022-01-04 16:57 ` Mika Westerberg
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Hans de Goede @ 2022-01-04 16:42 UTC (permalink / raw)
  To: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
	Linus Walleij
  Cc: Hans de Goede, linux-gpio, Jarkko Nikula

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 <jarkko.nikula@linux.intel.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index 683b95e9639a..5d85ef5d5da8 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -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);
-- 
2.33.1


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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-04 16:42 [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping Hans de Goede
@ 2022-01-04 16:57 ` Mika Westerberg
  2022-01-04 21:30 ` Andy Shevchenko
  2022-01-11 20:40 ` Andy Shevchenko
  2 siblings, 0 replies; 7+ messages in thread
From: Mika Westerberg @ 2022-01-04 16:57 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Andy Shevchenko, Bartosz Golaszewski, Linus Walleij, linux-gpio,
	Jarkko Nikula

On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
> 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 <jarkko.nikula@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>

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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-04 16:42 [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping Hans de Goede
  2022-01-04 16:57 ` Mika Westerberg
@ 2022-01-04 21:30 ` Andy Shevchenko
  2022-01-16  1:01   ` Linus Walleij
  2022-01-11 20:40 ` Andy Shevchenko
  2 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2022-01-04 21:30 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
	Linus Walleij, linux-gpio, Jarkko Nikula

On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
> 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.

Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

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

> Fixes: bdfbef2d29dc ("pinctrl: cherryview: Don't use selection 0 to mark an interrupt line as unused")
> Reported-and-tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/pinctrl/intel/pinctrl-cherryview.c | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
> index 683b95e9639a..5d85ef5d5da8 100644
> --- a/drivers/pinctrl/intel/pinctrl-cherryview.c
> +++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
> @@ -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);
> -- 
> 2.33.1
> 

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-04 16:42 [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping Hans de Goede
  2022-01-04 16:57 ` Mika Westerberg
  2022-01-04 21:30 ` Andy Shevchenko
@ 2022-01-11 20:40 ` Andy Shevchenko
  2022-01-12 19:11   ` Hans de Goede
  2 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2022-01-11 20:40 UTC (permalink / raw)
  To: Hans de Goede
  Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
	Linus Walleij, linux-gpio, Jarkko Nikula

On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
> 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.


-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-11 20:40 ` Andy Shevchenko
@ 2022-01-12 19:11   ` Hans de Goede
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2022-01-12 19:11 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski,
	Linus Walleij, linux-gpio, Jarkko Nikula

Hi,

On 1/11/22 21:40, Andy Shevchenko wrote:
> On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
>> 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.

Ok, thank you for looking into this.

Regards,

Hans


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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-04 21:30 ` Andy Shevchenko
@ 2022-01-16  1:01   ` Linus Walleij
  2022-01-16  9:38     ` Hans de Goede
  0 siblings, 1 reply; 7+ messages in thread
From: Linus Walleij @ 2022-01-16  1:01 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Hans de Goede, Mika Westerberg, Andy Shevchenko,
	Bartosz Golaszewski, linux-gpio, Jarkko Nikula

On Tue, Jan 4, 2022 at 10:31 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
> > 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.
>
> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> 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

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

* Re: [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping
  2022-01-16  1:01   ` Linus Walleij
@ 2022-01-16  9:38     ` Hans de Goede
  0 siblings, 0 replies; 7+ messages in thread
From: Hans de Goede @ 2022-01-16  9:38 UTC (permalink / raw)
  To: Linus Walleij, Andy Shevchenko
  Cc: Mika Westerberg, Andy Shevchenko, Bartosz Golaszewski, linux-gpio,
	Jarkko Nikula

Hi,

On 1/16/22 02:01, Linus Walleij wrote:
> On Tue, Jan 4, 2022 at 10:31 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
>> On Tue, Jan 04, 2022 at 05:42:38PM +0100, Hans de Goede wrote:
>>> 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.
>>
>> Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>>
>> 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.

> 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


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

end of thread, other threads:[~2022-01-16  9:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-04 16:42 [PATCH] pinctrl: cherryview: Trigger hwirq0 for interrupt-lines without a mapping Hans de Goede
2022-01-04 16:57 ` Mika Westerberg
2022-01-04 21:30 ` Andy Shevchenko
2022-01-16  1:01   ` Linus Walleij
2022-01-16  9:38     ` Hans de Goede
2022-01-11 20:40 ` Andy Shevchenko
2022-01-12 19:11   ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox