Skip to content

Commit 1c2e703

Browse files
ptalari27Linus Walleij
authored andcommitted
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 <[email protected]> Signed-off-by: Praveen Talari <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
1 parent 9b07cdf commit 1c2e703

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/pinctrl/qcom/pinctrl-msm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
189189
*/
190190
if (d && i != gpio_func &&
191191
!test_and_set_bit(d->hwirq, pctrl->disabled_for_mux))
192-
disable_irq(irq);
192+
disable_irq_nosync(irq);
193193

194194
raw_spin_lock_irqsave(&pctrl->lock, flags);
195195

0 commit comments

Comments
 (0)