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

From: Sergio Paracuellos

Date: Fri May 29 2026 - 02:16:17 EST


Hi Bartosz,

Thanks for reviewing!

On Wed, May 27, 2026 at 10:51 AM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
>
> On Tue, 26 May 2026 15:12:43 +0200, Sergio Paracuellos
> <sergio.paracuellos@xxxxxxxxx> said:
> >
> > 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, the solution adopted here is registering register a linear IRQ
>
> s/registering register/registering/ but better just use imperative tone:
> "Register a linear IRQ..."

Understood.

>
> ...
>
> > for (i = 0; i < MTK_BANK_CNT; i++) {
> > @@ -331,7 +466,17 @@ mediatek_gpio_probe(struct platform_device *pdev)
> > return ret;
> > }
> >
> > + if (mtk->gpio_irq > 0) {
> > + ret = mt7621_gpio_irq_setup(pdev, mtk);
> > + if (ret)
> > + goto fail;
> > + }
> > +
> > return 0;
> > +
> > +fail:
> > + mt7621_gpio_remove(pdev);
>
> Don't you need to undo this in remove path as well?

Yes, you are correct. I will add this for v2.

>
> The approach looks sane to me. I'll give some time for tglx or linusw to
> respond before queueing it for fixes.

Thanks, I am going to wait until next week and if no more comments
come I will send v2 with the commit message fixed and the remove stuff
added so you can enqueue that for fixes.

>
> Bart

Thanks,
Sergio Paracuellos