[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <84de6e73-31a1-4ae2-afe1-71e9947a22c0@quicinc.com>
Date: Thu, 8 Feb 2024 15:31:18 +0800
From: "Aiqun Yu (Maria)" <quic_aiquny@...cinc.com>
To: Linus Walleij <linus.walleij@...aro.org>
CC: <andersson@...nel.org>, <kernel@...cinc.com>, <linux-gpio@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linux-arm-msm@...r.kernel.org>
Subject: Re: [PATCH v4] pinctrl: Add lock to ensure the state atomization
On 2/7/2024 6:51 PM, Linus Walleij wrote:
> On Fri, Feb 2, 2024 at 11:59 AM Maria Yu <quic_aiquny@...cinc.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@...cinc.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
Powered by blists - more mailing lists