From: "Aiqun Yu (Maria)" <quic_aiquny@quicinc.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: <andersson@kernel.org>, <kernel@quicinc.com>,
<linux-gpio@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linux-arm-msm@vger.kernel.org>
Subject: Re: [PATCH v4] pinctrl: Add lock to ensure the state atomization
Date: Thu, 8 Feb 2024 15:31:18 +0800 [thread overview]
Message-ID: <84de6e73-31a1-4ae2-afe1-71e9947a22c0@quicinc.com> (raw)
In-Reply-To: <CACRpkdZM96tji2OCXHPd9iXE1kU5u1TGsuPhB0YLbHG=LXAiqg@mail.gmail.com>
On 2/7/2024 6:51 PM, Linus Walleij wrote:
> On Fri, Feb 2, 2024 at 11:59 AM Maria Yu <quic_aiquny@quicinc.com> wrote:
>
>> Currently pinctrl_select_state is an export symbol and don't have
>> effective re-entrance protect design. During async probing of devices
>> it's possible to end up in pinctrl_select_state() from multiple
>> contexts simultaneously, so make it thread safe.
>> More over, when the real racy happened, the system frequently have
>> printk message like:
>> "not freeing pin xx (xxx) as part of deactivating group xxx - it is
>> already used for some other setting".
>> Finally the system crashed after the flood log.
>> Add per pinctrl lock to ensure the old state and new state transition
>> atomization.
>> Also move dev error print message outside the region with interrupts
>> disabled.
>> Use scoped guard to simplify the lock protection needed code.
>>
>> Fixes: 4198a9b57106 ("pinctrl: avoid reload of p state in list iteration")
>> Signed-off-by: Maria Yu <quic_aiquny@quicinc.com>
>
> Thank you for rebasing!
>
> Patch applied now, so we get some shakeout in linux-next and can
> make sure it works for everyone.
Feel free to add me into any thread related. Also I will try to pay
attention from the email list.
:)
>
> Yours,
> Linus Walleij
--
Thx and BRs,
Aiqun(Maria) Yu
next prev parent reply other threads:[~2024-02-08 7:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-02 10:58 Maria Yu
2024-02-02 11:09 ` Aiqun Yu (Maria)
2024-02-07 10:51 ` Linus Walleij
2024-02-08 7:31 ` Aiqun Yu (Maria) [this message]
2024-02-09 8:37 ` Alexander Stein
2024-02-09 13:32 ` Linus Walleij
2024-02-20 6:13 ` Aiqun Yu (Maria)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84de6e73-31a1-4ae2-afe1-71e9947a22c0@quicinc.com \
--to=quic_aiquny@quicinc.com \
--cc=andersson@kernel.org \
--cc=kernel@quicinc.com \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®