[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAD=FV=Uzu=37nqGZYu4cU7fMMV2u+e8-GF1+izcvusOT+a1f=Q@mail.gmail.com>
Date: Wed, 30 Aug 2023 13:54:21 -0700
From: Doug Anderson <dianders@...omium.org>
To: Michał Mirosław <mirq-linux@...e.qmqm.pl>
Cc: Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, linux-kernel@...r.kernel.org,
Stephen Boyd <swboyd@...omium.org>
Subject: Re: [PATCH v2 3/7] regulator/core: regulator_lock_nested: simplify
nested locking
Hi,
On Wed, Aug 30, 2023 at 10:35 AM Michał Mirosław
<mirq-linux@...e.qmqm.pl> wrote:
>
> Simplify regulator locking by removing locking around locking.
> rdev->ref check when unlocking is moved inside the critical section.
>
> This patch depends on commit 12235da8c80a ("kernel/locking: Add context
> to ww_mutex_trylock()").
>
> Note: return -EALREADY is removed as no caller depends on it and in that
> case the lock count is incremented anyway.
>
> Reviewed-by: Douglas Anderson <dianders@...omium.org>
> Signed-off-by: Michał Mirosław <mirq-linux@...e.qmqm.pl>
> ---
> drivers/regulator/core.c | 23 ++++++-----------------
> 1 file changed, 6 insertions(+), 17 deletions(-)
Note that I didn't actually provide a Reviewed-by on this patch in v1.
I was hoping for something in the commit message that explained why
commit 12235da8c80a ("kernel/locking: Add context to
ww_mutex_trylock()") meant that we didn't need the extra lock. You
responded to the v1, but didn't add anything to the commit message
about it.
Looking at your response to v1, I'm not sure it helps enlighten me on
why adding the context removed the need for the extra lock. Can you
add more words? Pretend I don't know anything about ww_mutex, which is
not far from the truth since every time I look at ww_mutex I have to
re-learn how it works. :-P Specifically, what would actually have been
broken without the extra lock but before the context was added?
-Doug
Powered by blists - more mailing lists