Re: [PATCH v2 3/4] gpio: mt7621: be sure IRQ domain is created before exposing GPIO chips

From: Sergio Paracuellos

Date: Tue Jun 30 2026 - 10:13:30 EST


Hi Bartosz,

On Tue, Jun 30, 2026 at 4:06 PM Bartosz Golaszewski <brgl@xxxxxxxxxx> wrote:
>
> On Fri, 26 Jun 2026 08:01:11 +0200, Sergio Paracuellos
> <sergio.paracuellos@xxxxxxxxx> said:
> > Function 'mediatek_gpio_bank_probe()' registers three GPIO chips using
> > 'devm_gpiochip_add_data()'. At this point, the chips become live and visible
> > to consumers. However, the IRQ domain isn't allocated and set up until
> > 'mt7621_gpio_irq_setup()' is called after the GPIO chips setup finishes.
> > If a consumer requests a GPIO IRQ concurrently 'mt7621_gpio_to_irq()' can
> > be called and pass a NULL irq domain pointer irq_create_mapping(), that can
> > corrupt the mappings or cause a crash. Fix this possible problem seting up
> > irq domain before GPIO chips setup is performed.
> >
> > Cc: stable@xxxxxxxxxxxxxxx
> > Reported-by: Sashiko <sashiko-bot@xxxxxxxxxx>
> > Fixes: a46f2e5720f5 ("gpio: mt7621: fix interrupt banks mapping on gpio chips")
> > Signed-off-by: Sergio Paracuellos <sergio.paracuellos@xxxxxxxxx>
> > ---
>
> Seems like sashiko still complains about this one. I'm not overly worried about
> this path but since the commit's purpose was to address this very issue, do you
> want to rework it further?

Previous complaint was about the IRQ mapping being NULL because
mapping was not created when gpio chips are set up. I think that it
made more sense that this new complaint about the reverse order. So I
would maintain this PATCH as it is. Thus, I don't want to rework
anything here.

Thanks,
Sergio Paracuellos