Re: [PATCH v3 4/7] gpio: gpiolib: fix allocation order in hierarchical IRQ domains

From: Bartosz Golaszewski

Date: Wed Mar 11 2026 - 10:20:46 EST


On Wed, Mar 11, 2026 at 2:40 PM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
>
> On Wed, Mar 11, 2026 at 02:18:05AM -0700, Bartosz Golaszewski wrote:
> > On Tue, 10 Mar 2026 10:14:59 +0100, Bartosz Golaszewski <brgl@xxxxxxxxxx> said:
> > > On Tue, Mar 10, 2026 at 10:05 AM Linus Walleij <linusw@xxxxxxxxxx> wrote:
> > >>
> > >> On Mon, Mar 9, 2026 at 2:49 PM Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx> wrote:
> > >>
> > >> > In gpiochip_hierarchy_irq_domain_alloc(), calling irq_domain_set_info()
> > >> > before irq_domain_alloc_irqs_parent() causes a NULL pointer dereference
> > >> > for slow-bus (SPI/I2C) IRQ chips.
> > >> >
> > >> > irq_domain_set_info() locks the child descriptor, triggering .irq_bus_lock.
> > >> > If the child proxies this lock to the parent, it crashes because
> > >> > parent->chip is not yet allocated.
> > >> >
> > >> > Fix this by allocating the parent IRQs first, ensuring parent->chip is
> > >> > populated before the child's .irq_bus_lock is invoked.
> > >> >
> > >> > Signed-off-by: Oleksij Rempel <o.rempel@xxxxxxxxxxxxxx>
> > >> > ---
> > >> > changes v3
> > >> > - new patch
> > >>
> > >> Bartosz, tglx: is this something we should apply for fixes?
> > >>
> > >> I think it needs to go into gpiolib for next at minimum, unless
> > >> there is some semantic problem with the patch.
> > >>
> > >
> > > Looks good to me. I can take it into v7.0-rc4 via the GPIO tree and
> > > tglx can pull the tag once it's out as a base for the rest of the
> > > series?
> > >
> > > Bart
> > >
> >
> > Oleksij: it doesn't look like there are any dependencies for this patch, is
> > it ok if I queue it for the next RC?
>
> ACK, there are no dependencies.
>
> > Could you add the Fixes tag as well?
>
> Fixes: fdd61a013a24 ("gpio: Add support for hierarchical IRQ domains")
>
> Should add it in the next round? There are some pending comments for
> this patch set.
>

No, you can drop it, I'll send it for v7.0-rc4.

Bart