mbox series

[0/8] clk: qcom: fix runtime PM bugs

Message ID 20230718132902.21430-1-johan+linaro@kernel.org
Headers show
Series clk: qcom: fix runtime PM bugs | expand

Message

Johan Hovold July 18, 2023, 1:28 p.m. UTC
This series fixes a number of runtime PM related bugs found through
inspection.

Johan


Johan Hovold (8):
  clk: qcom: camcc-sc7180: fix async resume during probe
  clk: qcom: dispcc-sm8450: fix runtime PM imbalance on probe errors
  clk: qcom: dispcc-sm8550: fix runtime PM imbalance on probe errors
  clk: qcom: gcc-sc8280xp: fix runtime PM imbalance on probe errors
  clk: qcom: lpasscc-sc7280: fix missing resume during probe
  clk: qcom: q6sstop-qcs404: fix missing resume during probe
  clk: qcom: mss-sc7180: fix missing resume during probe
  clk: qcom: turingcc-qcs404: fix missing resume during probe

 drivers/clk/qcom/camcc-sc7180.c    |  2 +-
 drivers/clk/qcom/dispcc-sm8450.c   | 13 +++++++++++--
 drivers/clk/qcom/dispcc-sm8550.c   | 13 +++++++++++--
 drivers/clk/qcom/gcc-sc8280xp.c    | 14 +++++++++++---
 drivers/clk/qcom/lpasscc-sc7280.c  | 16 ++++++++++++----
 drivers/clk/qcom/mss-sc7180.c      | 13 ++++++++++++-
 drivers/clk/qcom/q6sstop-qcs404.c  | 15 +++++++++++++--
 drivers/clk/qcom/turingcc-qcs404.c | 13 ++++++++++++-
 8 files changed, 83 insertions(+), 16 deletions(-)

Comments

Konrad Dybcio July 18, 2023, 1:46 p.m. UTC | #1
On 18.07.2023 15:28, Johan Hovold wrote:
> This series fixes a number of runtime PM related bugs found through
> inspection.
> 
> Johan
I was thinking whether we should maybe incorporate RPM enablement
into qcom common functions.. The only issue I see is that some
clocks register pm clocks atop that, but I guess we could introduce
some sort of a pm_clks names array to solve that?

Konrad
Johan Hovold July 18, 2023, 3:39 p.m. UTC | #2
On Tue, Jul 18, 2023 at 07:58:41AM -0700, Bjorn Andersson wrote:
> On Tue, Jul 18, 2023 at 03:28:59PM +0200, Johan Hovold wrote:
> > Drivers that enable runtime PM must make sure that the controller is
> > runtime resumed before accessing its registers to prevent the power
> > domain from being disabled.
> > 
> 
> NB: the clock framework will runtime resume the controller surrounding
> operations, even so during probe. But this is not done for resets and
> gdscs - and in some clock drivers we poke registers directly from
> probe...
> 
> The one time this really matters is where we associate the ahb clock
> with the runtime state, e.g. in qcs404 turingcc. On most other platforms
> we just mark these clocks always-on in gcc...

Right, I started looking at this with respect to the PM domain, but
my initial commit message only mentioned the need to make sure the
controller is resumed, which would have covered such interface clocks as
well. 

And while ending up with a concurrent request to disable the PM domain
is not that likely, there is currently nothing preventing it so it still
needs to be fixed.

Johan
Johan Hovold July 19, 2023, 7:23 a.m. UTC | #3
On Tue, Jul 18, 2023 at 03:46:03PM +0200, Konrad Dybcio wrote:
> On 18.07.2023 15:28, Johan Hovold wrote:
> > This series fixes a number of runtime PM related bugs found through
> > inspection.

> I was thinking whether we should maybe incorporate RPM enablement
> into qcom common functions.. The only issue I see is that some
> clocks register pm clocks atop that, but I guess we could introduce
> some sort of a pm_clks names array to solve that?

Possibly, but you currently also have the hardcoded clock enables and
some other variations.

Johan