lkml.org 
[lkml]   [2022]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH 0/2] clk: Avoid potential deadlock when disabling unused clocks
Date
These two patches together fix a deadlock that I seem to be hitting
every time with my particular setup (a sc7280-herobrine board running
the downstream chromeos-5.15 kernel).

FWIW:
* Others tried with the very a similar setup to me and they didn't
reproduce the hang, which makes sense after the analysis in the
commit message of the clock patch. To hit this you just need to be
lucky.
* I bisected this in our tree and landed on a cherry-pick of commit
1b771839de05 ("clk: qcom: gdsc: enable optional power domain
support") as the first one where I saw the hang (and the "fix" of
that commit upstream didn't change things). Nothing about that patch
was directly touching the code paths that my analysis showed so I
can only assume it changed the timing in a way to make this happen
reliably for me.

While the solution proposed in this patch series doesn't seem too
terrible to me, it's still not exactly elegant. This is why I'm
marking it as an RFC. If someone wants to send out patches that solve
this in a better way then I'd be more than happy.

NOTE also that at the same time I started getting the deadlock I also
started getting a lockdep warning talking about similar locks.
Unfortunately, the lockdep warning seems to be unrelated. This fix
handles the deadlock but the lockdep still shows up. I can also fix
the lockdep without fixing the deadlock. I'll send a separate patch
about the lockdep.


Douglas Anderson (2):
PM: runtime: Add pm_runtime_try_put_sync() and
pm_runtime_try_get_sync()
clk: core: Avoid potential deadlock when disabling unused clocks

drivers/base/power/runtime.c | 7 +-
drivers/clk/clk.c | 137 ++++++++++++++++++++++++++++-------
include/linux/pm_runtime.h | 28 +++++++
3 files changed, 143 insertions(+), 29 deletions(-)

--
2.37.3.968.ga6b4b080e4-goog

\
 
 \ /
  Last update: 2022-09-22 17:45    [W:0.069 / U:0.064 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site