Thread (10 messages) 10 messages, 4 authors, 2026-03-19

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

From: Michal Piekos <hidden>
Date: 2026-03-19 14:49:52
Also in: linux-gpio, linux-sunxi, lkml

On Thu, Mar 19, 2026 at 03:16:33PM +0100, Andre Przywara wrote:
Hi,

On 3/19/26 15:06, Chen-Yu Tsai wrote:
quoted
On Thu, Mar 19, 2026 at 9:46 PM Linus Walleij [off-list ref] wrote:
quoted
On Sat, Mar 14, 2026 at 9:10 AM Michal Piekos
[off-list ref] wrote:
quoted
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 <redacted>
Suggested-by: Chen-Yu Tsai <wens@kernel.org>
Should this have a Fixes: tag and should it be applied as an urgent fix?
Fixes: 01e10d0272b9 ("pinctrl: sunxi: Implement gpiochip::get_direction()")
quoted
Tag for stable?
The original patch wasn't tagged for stable. And it doesn't seem like it
was auto picked.
quoted
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|.
There is already the SUNXI_PINCTRL_NEW_REG_LAYOUT flag, which describes
exactly that: the new layout increased the bit field to 4 bits, moving the
HiZ value to 0xf.
But it's just a flag passed to sunxi_pinctrl_init_with_flags(), not stored
in desc, and not available during runtime. Which is what I tried to fix for
my A733 series:
https://lore.kernel.org/linux-arm-kernel/20250821004232.8134-3-andre.przywara@arm.com/ (local)

So maybe we can cherry-pick just this patch, then check for that flag?
I'll prepare v4 with your suggestion.
Cheers,
Andre
quoted
Michal, can you respin a version so that we can get this fixed in the
same release?


ChenYu
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help