* [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled
@ 2022-07-13 21:28 Bjorn Andersson
2022-07-18 19:15 ` Stephen Boyd
2022-07-19 4:47 ` (subset) " Bjorn Andersson
0 siblings, 2 replies; 3+ messages in thread
From: Bjorn Andersson @ 2022-07-13 21:28 UTC (permalink / raw)
To: Bjorn Andersson, Stephen Boyd
Cc: Konrad Dybcio, Michael Turquette, Dmitry Baryshkov,
linux-arm-msm, linux-clk, linux-kernel
When a GDSC is found to be enabled at boot the pm_runtime state will
be unbalanced as the GDSC is later turned off. Fix this by increasing
the usage counter on the power-domain, in line with how we handled the
regulator state.
Fixes: 1b771839de05 ("clk: qcom: gdsc: enable optional power domain support")
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
---
Changes since v1:
- Added error handling
drivers/clk/qcom/gdsc.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/clk/qcom/gdsc.c b/drivers/clk/qcom/gdsc.c
index 6f746158d28f..d3244006c661 100644
--- a/drivers/clk/qcom/gdsc.c
+++ b/drivers/clk/qcom/gdsc.c
@@ -437,6 +437,14 @@ static int gdsc_init(struct gdsc *sc)
return ret;
}
+ /* ...and the power-domain */
+ ret = gdsc_pm_runtime_get(sc);
+ if (ret) {
+ if (sc->rsupply)
+ regulator_disable(sc->rsupply);
+ return ret;
+ }
+
/*
* Votable GDSCs can be ON due to Vote from other masters.
* If a Votable GDSC is ON, make sure we have a Vote.
--
2.35.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled
2022-07-13 21:28 [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled Bjorn Andersson
@ 2022-07-18 19:15 ` Stephen Boyd
2022-07-19 4:47 ` (subset) " Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Stephen Boyd @ 2022-07-18 19:15 UTC (permalink / raw)
To: Bjorn Andersson
Cc: Konrad Dybcio, Michael Turquette, Dmitry Baryshkov,
linux-arm-msm, linux-clk, linux-kernel
Quoting Bjorn Andersson (2022-07-13 14:28:18)
> When a GDSC is found to be enabled at boot the pm_runtime state will
> be unbalanced as the GDSC is later turned off. Fix this by increasing
> the usage counter on the power-domain, in line with how we handled the
> regulator state.
>
> Fixes: 1b771839de05 ("clk: qcom: gdsc: enable optional power domain support")
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: (subset) [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled
2022-07-13 21:28 [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled Bjorn Andersson
2022-07-18 19:15 ` Stephen Boyd
@ 2022-07-19 4:47 ` Bjorn Andersson
1 sibling, 0 replies; 3+ messages in thread
From: Bjorn Andersson @ 2022-07-19 4:47 UTC (permalink / raw)
To: bjorn.andersson, sboyd
Cc: linux-arm-msm, mturquette, linux-kernel, dmitry.baryshkov,
linux-clk, Konrad Dybcio
On Wed, 13 Jul 2022 14:28:18 -0700, Bjorn Andersson wrote:
> When a GDSC is found to be enabled at boot the pm_runtime state will
> be unbalanced as the GDSC is later turned off. Fix this by increasing
> the usage counter on the power-domain, in line with how we handled the
> regulator state.
>
>
Applied, thanks!
[1/1] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled
commit: 41fff779d7948147f2440c4bb134cdf8b45b22d7
Best regards,
--
Bjorn Andersson <bjorn.andersson@linaro.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-07-19 4:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-13 21:28 [PATCH v2] clk: qcom: gdsc: Bump parent usage count when GDSC is found enabled Bjorn Andersson
2022-07-18 19:15 ` Stephen Boyd
2022-07-19 4:47 ` (subset) " Bjorn Andersson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).