[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <z2oh7r56b7w3genfbq4jj24nvjehmnncufwwp6oj6duhafdaja@f2dle7jfao7e>
Date: Tue, 11 Nov 2025 09:35:43 -0600
From: Bjorn Andersson <andersson@...nel.org>
To: Praveen Talari <praveen.talari@....qualcomm.com>
Cc: Konrad Dybcio <konradybcio@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Linus Walleij <linus.walleij@...aro.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jiri Slaby <jirislaby@...nel.org>, Dmitry Baryshkov <lumag@...nel.org>,
linux-arm-msm@...r.kernel.org, devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-gpio@...r.kernel.org, linux-serial@...r.kernel.org, alexey.klimov@...aro.org,
krzk@...nel.org, bryan.odonoghue@...aro.org, jorge.ramirez@....qualcomm.com,
dmitry.baryshkov@....qualcomm.com, Konrad Dybcio <konrad.dybcio@....qualcomm.com>,
psodagud@...cinc.com, djaggi@...cinc.com, quic_msavaliy@...cinc.com,
quic_vtanuku@...cinc.com, quic_arandive@...cinc.com, quic_shazhuss@...cinc.com,
quic_cchiluve@...cinc.com, Prasad Sodagudi <prasad.sodagudi@....qualcomm.com>
Subject: Re: [PATCH v1 2/4] pinctrl: qcom: msm: Fix potential deadlock in
pinmux configuration
On Tue, Nov 11, 2025 at 10:52:25AM +0530, Praveen Talari wrote:
> Hi Bjorn,
>
> Thank you for review.
>
> On 11/11/2025 9:38 AM, Bjorn Andersson wrote:
> > On Mon, Nov 10, 2025 at 03:40:41PM +0530, Praveen Talari 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
> >
> > "potential"? In what case will calling disable_irq() from the irq
> > handler of that irq not deadlock?
> >
> > > 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@....qualcomm.com>
> >
> > That's weird, I debugged your deadlock for you and told you to make this
> > very change in:
> >
> > https://lore.kernel.org/all/7sxsfyu2kqbycyfftwfhrncwk3dfnubmzhyi2rqi3jtvi5qsnh@bya3cii45zhn/
> >
> > So I guess Prasad told you how to fix this issue before I invested the
> > time helping you?
>
> Yes, that’s correct. Prasad had suggested it earlier.
>
Okay, then this patch looks good.
Regards,
Bjorn
> Thanks,
> Praveen Talari
>
> >
> >
> > Change looks good, and description captures the problem.
> >
> > Reviewed-by: Bjorn Andersson <andersson@...nel.org>
> >
> > Regards,
> > Bjorn
> >
> > > Signed-off-by: Praveen Talari <praveen.talari@....qualcomm.com>
> > > ---
> > > drivers/pinctrl/qcom/pinctrl-msm.c | 2 +-
> > > 1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/pinctrl/qcom/pinctrl-msm.c b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > index 67525d542c5b..e99871b90ab9 100644
> > > --- a/drivers/pinctrl/qcom/pinctrl-msm.c
> > > +++ b/drivers/pinctrl/qcom/pinctrl-msm.c
> > > @@ -189,7 +189,7 @@ static int msm_pinmux_set_mux(struct pinctrl_dev *pctldev,
> > > */
> > > if (d && i != gpio_func &&
> > > !test_and_set_bit(d->hwirq, pctrl->disabled_for_mux))
> > > - disable_irq(irq);
> > > + disable_irq_nosync(irq);
> > > raw_spin_lock_irqsave(&pctrl->lock, flags);
> > > --
> > > 2.34.1
> > >
Powered by blists - more mailing lists