Re: [PATCH v1 2/4] pinctrl: qcom: msm: Fix potential deadlock in pinmux configuration
From: Linus Walleij
Date: Wed Nov 12 2025 - 07:43:45 EST
Hi Praveen,
thanks for your patch!
On Mon, Nov 10, 2025 at 11:11 AM Praveen Talari
<praveen.talari@xxxxxxxxxxxxxxxx> wrote:
> Replace disable_irq() with disable_irq_nosync() in msm_pinmux_set_mux()
> to prevent potential deadlock when wakeup IRQ is triggered on the same
> GPIO being reconfigured.
>
> The issue occurs when a wakeup IRQ is triggered on a GPIO and the IRQ
> handler attempts to reconfigure the same GPIO's pinmux. In this scenario,
> msm_pinmux_set_mux() calls disable_irq() which waits for the currently
> running IRQ handler to complete, creating a circular dependency that
> results in deadlock.
>
> Using disable_irq_nosync() avoids waiting for the IRQ handler to
> complete, preventing the deadlock condition while still properly
> disabling the interrupt during pinmux reconfiguration.
>
> Suggested-by: Prasad Sodagudi <prasad.sodagudi@xxxxxxxxxxxxxxxx>
> Signed-off-by: Praveen Talari <praveen.talari@xxxxxxxxxxxxxxxx>
I applied this patch 2/4 to the pin control tree for fixes.
I removed the word "potential" from subject and text so as to
reflect what Bjorn is saying: it's a very real issue.
Thanks for fixing this!
Linus Walleij