From: Stephen Boyd <sboyd@kernel.org>
To: Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>
Cc: linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
patches@lists.linux.dev, linux-arm-msm@vger.kernel.org,
Douglas Anderson <dianders@chromium.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Taniya Das <quic_tdas@quicinc.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Subject: Re: [PATCH v2 0/5] Fix a deadlock with clk_pm_runtime_get()
Date: Mon, 25 Mar 2024 11:44:26 -0700 [thread overview]
Message-ID: <6c8ed50511cbcbf07ef165d900c689e2.sboyd@kernel.org> (raw)
In-Reply-To: <20240325184204.745706-1-sboyd@kernel.org>
Quoting Stephen Boyd (2024-03-25 11:41:54)
> This patch series fixes a deadlock reported[1] on ChromeOS devices
> (Qualcomm sc7180 Trogdor). To get there, we allow __clk_release() to run
> without the prepare_lock held. Then we add runtime PM enabled clk_core
> structs to a list that we iterate and enable runtime PM for each entry
> before grabbing the prepare_lock to walk the clk tree. The details are
> in patch #4.
>
> The patch after that is based on the analysis in the disable unused
> patch. We similarly resume devices from runtime suspend when walking the
> clk tree for the debugfs clk_summary.
>
> Unfortunately this doesn't fix all problems with the usage of runtime PM
> in the clk framework. We still have a problem if preparing a clk happens
> in parallel to the device providing that clk runtime resuming or
> suspending. In that case, the task will go to sleep waiting for the
> runtime PM state to change, and we'll deadlock. This is primarily a
> problem with the global prepare_lock. I suspect we'll be able to fix
> this by implementing per-clk locking, because then we will be able to
> split up the big prepare_lock into smaller locks that don't deadlock on
> some device runtime PM transitions.
>
> I'll start working on that problem in earnest now because I'm worried
> we're going to run into that problem very soon.
>
> Changes from v1 (https://lore.kernel.org/r/):
Oops this is https://lore.kernel.org/r/20240325054403.592298-1-sboyd@kernel.org
prev parent reply other threads:[~2024-03-25 18:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-03-25 18:41 [PATCH v2 0/5] Fix a deadlock with clk_pm_runtime_get() Stephen Boyd
2024-03-25 18:41 ` [PATCH v2 1/5] clk: Remove prepare_lock hold assertion in __clk_release() Stephen Boyd
2024-04-08 2:35 ` Stephen Boyd
2024-03-25 18:41 ` [PATCH v2 2/5] clk: Don't hold prepare_lock when calling kref_put() Stephen Boyd
2024-04-08 2:35 ` Stephen Boyd
2024-03-25 18:41 ` [PATCH v2 3/5] clk: Initialize struct clk_core kref earlier Stephen Boyd
2024-04-08 2:36 ` Stephen Boyd
2024-03-25 18:41 ` [PATCH v2 4/5] clk: Get runtime PM before walking tree during disable_unused Stephen Boyd
2024-03-25 19:39 ` Doug Anderson
2024-04-08 2:36 ` Stephen Boyd
2024-04-09 10:32 ` Ulf Hansson
2024-04-09 11:55 ` Stephen Boyd
2024-03-25 18:41 ` [PATCH v2 5/5] clk: Get runtime PM before walking tree for clk_summary Stephen Boyd
2024-03-25 19:39 ` Doug Anderson
2024-04-08 2:37 ` Stephen Boyd
2024-03-25 18:44 ` Stephen Boyd [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6c8ed50511cbcbf07ef165d900c689e2.sboyd@kernel.org \
--to=sboyd@kernel.org \
--cc=dianders@chromium.org \
--cc=krzk@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=mturquette@baylibre.com \
--cc=patches@lists.linux.dev \
--cc=quic_tdas@quicinc.com \
--cc=ulf.hansson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox