Re: [PATCH] clk: qcom: rcg2: Cache rate changes for parked RCGs

From: Steev Klimaszewski
Date: Fri Dec 03 2021 - 22:16:57 EST



On 12/3/21 6:39 PM, Steev Klimaszewski wrote:

On 12/2/21 9:56 PM, Bjorn Andersson wrote:
As GDSCs are turned on and off some associated clocks are momentarily
enabled for house keeping purposes. Failure to enable these clocks seems
to have been silently ignored in the past, but starting in SM8350 this
failure will prevent the GDSC to turn on.

At least on SM8350 this operation will enable the RCG per the
configuration in CFG_REG. This means that the current model where the
current configuration is written back to CF_REG immediately after
parking the RCG doesn't work.

Instead, keep track of the currently requested rate of the clock and
upon enabling the clock reapply the configuration per the saved rate.

Fixes: 7ef6f11887bd ("clk: qcom: Configure the RCGs to a safe source as needed")
Signed-off-by: Bjorn Andersson <bjorn.andersson@xxxxxxxxxx>
---
  drivers/clk/qcom/clk-rcg.h  |  2 ++
  drivers/clk/qcom/clk-rcg2.c | 32 +++++++++++++++++---------------
  2 files changed, 19 insertions(+), 15 deletions(-)

<snip patch>

With this applied, I'm getting
<snip>

Actually turns out, I had a testing patch in from Dmitry that I'd never taken back out when it was decided it wasn't good enough. Apologies for the useless message.  This does not actually cause the issue, just the combination of them does.

Tested on the Lenovo Yoga C630

Tested-By: Steev Klimaszewski <steev@xxxxxxxx>