Re: [PATCH] of/irq: Add a quirk for controllers with their own definition of interrupt-map

From: Geert Uytterhoeven
Date: Tue Nov 23 2021 - 06:02:51 EST

Hi Marc,

On Tue, Nov 23, 2021 at 9:33 AM Marc Zyngier <maz@xxxxxxxxxx> wrote:
> On Tue, 23 Nov 2021 07:57:48 +0000,
> Geert Uytterhoeven <geert@xxxxxxxxxxxxxx> wrote:
> > Summarized:
> > - Before the bad commit, and after your fix, irqc-rza1 is invoked,
> > and the number of interrupts seen is correct, but input events
> > are doubled.
> > - After the bad commit, irqc-rza1 is not invoked, and there is an
> > interrupt storm, but input events are OK.
> OK, that's reassuring, even if the "twice the events" stuff isn't what
> you'd expect. We at least know this is a separate issue, and that this
> patch on top of -rc1 brings you back to the 5.15 behaviour.

So the "twice the events" stuff did happen before, and is caused by
gpio-keys always fabricating timer-based auto-"up" events when using
"interrupts" instead of "gpios".

arch/arm/boot/dts/r7s72100-rskrza1.dts has IRQ_TYPE_EDGE_BOTH to
detect the real "up", which becomes a second set of "down"/"up" events.
Using IRQ_TYPE_EDGE_FALLING gets rid of the dupe by only detecting
the real "down" event. Similar for IRQ_TYPE_LEVEL_LOW, but then
there's a temporary interrupt storm until the key is released.

Seems like gpio-keys needs to be fixed for IRQ_TYPE_EDGE_BOTH.
When using "gpios" instead of "interrupts", it does pass



Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds