Re: [PATCH] soc: qcom: pmic_glink: Make client-lock non-sleeping

From: Dmitry Baryshkov
Date: Wed May 01 2024 - 00:03:22 EST


On Wed, 1 May 2024 at 06:33, Bjorn Andersson <andersson@xxxxxxxxxx> wrote:
>
> From: Bjorn Andersson <quic_bjorande@xxxxxxxxxxx>
>
> The recently introduced commit '635ce0db8956 ("soc: qcom: pmic_glink:
> don't traverse clients list without a lock")' ensured that the clients
> list is not modified while traversed.
>
> But the callback is made from the GLINK IRQ handler and as such this
> mutual exclusion can not be provided by a (sleepable) mutex.
>
> Replace the mutex with a spinlock.
>
> Fixes: 635ce0db8956 ("soc: qcom: pmic_glink: don't traverse clients list without a lock")
> Signed-off-by: Bjorn Andersson <quic_bjorande@xxxxxxxxxxx>
> ---
> drivers/soc/qcom/pmic_glink.c | 25 +++++++++++++++----------
> 1 file changed, 15 insertions(+), 10 deletions(-)
>

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@xxxxxxxxxx>

--
With best wishes
Dmitry