Re: [PATCH v3] pinctrl: sunxi: fix gpiochip_lock_as_irq() failure when pinmux is unknown

From: Michal Piekos

Date: Thu Mar 19 2026 - 10:29:53 EST


On Thu, Mar 19, 2026 at 10:06:55PM +0800, Chen-Yu Tsai wrote:
> On Thu, Mar 19, 2026 at 9:46 PM Linus Walleij <linusw@xxxxxxxxxx> wrote:
> >
> > On Sat, Mar 14, 2026 at 9:10 AM Michal Piekos
> > <michal.piekos@xxxxxxxxxxxxx> wrote:
> >
> > > Fixes kernel hang during boot due to inability to set up IRQ on AXP313a.
> > >
> > > The issue is caused by gpiochip_lock_as_irq() which is failing when gpio
> > > is in unitialized state.
> > >
> > > Solution is to set pinmux to GPIO INPUT in
> > > sunxi_pinctrl_irq_request_resources() if it wasn't initialized
> > > earlier.
> > >
> > > Tested on Orange Pi Zero 3.
> > >
> > > Signed-off-by: Michal Piekos <michal.piekos@xxxxxxxxxxxxx>
> > > Suggested-by: Chen-Yu Tsai <wens@xxxxxxxxxx>
> >
> > Should this have a Fixes: tag and should it be applied as an urgent fix?
>
> Fixes: 01e10d0272b9 ("pinctrl: sunxi: Implement gpiochip::get_direction()")
>
> > Tag for stable?
>
> The original patch wasn't tagged for stable. And it doesn't seem like it
> was auto picked.
>
> > Also: is there consensus with Andre that this is the way to proceed?
>
> As Andre mentioned, the mux value for "disabled" is different between
> generations. So we likely need to make the value part of
> |struct sunxi_pinctrl_desc|.
>
> Michal, can you respin a version so that we can get this fixed in the
> same release?
>

Yes but I am quite new to this so it might take me few hours to
understand the proposed solution and implement it.

>
> ChenYu