[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACRpkdZM96tji2OCXHPd9iXE1kU5u1TGsuPhB0YLbHG=LXAiqg@mail.gmail.com>
Date: Wed, 7 Feb 2024 11:51:30 +0100
From: Linus Walleij <linus.walleij@...aro.org>
To: Maria Yu <quic_aiquny@...cinc.com>
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 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.
Yours,
Linus Walleij
Powered by blists - more mailing lists