Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pinctrl: qcom: msm: Fix deadlock in pinmux configuration

Replace disable_irq() with disable_irq_nosync() in msm_pinmux_set_mux()
to prevent 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@oss.qualcomm.com>
Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>

authored by

Praveen Talari and committed by
Linus Walleij
1c2e7039 9b07cdf8

+1 -1
+1 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 189 189 */ 190 190 if (d && i != gpio_func && 191 191 !test_and_set_bit(d->hwirq, pctrl->disabled_for_mux)) 192 - disable_irq(irq); 192 + disable_irq_nosync(irq); 193 193 194 194 raw_spin_lock_irqsave(&pctrl->lock, flags); 195 195