Re: [PATCH v2] gpio: mt7621: fix interrupt banks mapping on gpio chips

From: Bartosz Golaszewski

Date: Mon Jun 08 2026 - 05:11:36 EST


On Tue, 2 Jun 2026 16:25:13 +0200, Sergio Paracuellos
<sergio.paracuellos@xxxxxxxxx> said:
> The GPIO controller's registers are organized as sets of eight 32-bit
> registers with each set controlling a bank of up to 32 pins. A single
> interrupt is shared for all of the banks handled by the controller.
> The driver implements this using three gpio chip instances every one
> with its own irq chip. Every single pin can generate interrupts having
> a total of 96 possible interrupts here. It looks like there is a problem
> with interrupts being properly mapped to the gpio bank using this solution.
> This problem report is in the following lore's link [0].
>
> Device tree is using two cells for this, so only the interrupt pin and the
> interrupt type are described there. Changing to have three cells to setup
> also the bank and implement 'of_node_instance_match()' would also work but
> this would be an ABI breakage and also a bit incoherent since gpios itself
> are also using two cells and properly mapped in desired bank using through
> its pin number on 'of_xlate()'.
>
> That said, register a linear IRQ domain of the total of 96 interrupts shared
> with the three gpio chip instances so the bank and the interrupt is properly
> decoded and devices using gpio IRQs properly work.
>
> [0]: https://lore.kernel.org/linux-gpio/CAAMcf8C_A9dJ_v4QRKtb9eGNOpJ7BZNOGsFP4i2WFOZxOVBPnQ@xxxxxxxxxxxxxx/T/#u
>
> Fixes: 4ba9c3afda41 ("gpio: mt7621: Add a driver for MT7621")
> Co-developed-by: Vicente Bergas <vicencb@xxxxxxxxx>
> Signed-off-by: Vicente Bergas <vicencb@xxxxxxxxx>
> Tested-by: Vicente Bergas <vicencb@xxxxxxxxx>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
> ---

Hi!

Can you look at the sashiko review? Especially the bit about tracking the
GPIOD_FLAG_IRQ_IS_ENABLED flag looks correct.

Bart