mbox series

[v3,0/7] Clock changes to support cpufreq on QCS404

Message ID 20191125135910.679310-1-niklas.cassel@linaro.org
Headers show
Series Clock changes to support cpufreq on QCS404 | expand

Message

Niklas Cassel Nov. 25, 2019, 1:59 p.m. UTC
The following clock changes are required to enable cpufreq support on
the QCS404.

Changes since v2:
-Addressed Stephen Boyd's comment regarding apcs-msm8916
should use new way of specifying clock parents.
-DT binding now has "pll" as first clock, in order to
not break DT backwards compatibility (in case no clock-names
are given).
-Moved EPROBE_DEFER error handling to its own patch.

Jorge Ramirez-Ortiz (6):
  dt-bindings: mailbox: qcom: Add clock-name optional property
  clk: qcom: gcc: limit GPLL0_AO_OUT operating frequency
  clk: qcom: hfpll: register as clock provider
  clk: qcom: hfpll: CLK_IGNORE_UNUSED
  clk: qcom: hfpll: use clk_parent_data to specify the parent
  clk: qcom: apcs-msm8916: silently error out on EPROBE_DEFER

Niklas Cassel (1):
  clk: qcom: apcs-msm8916: use clk_parent_data to specify the parent

 .../mailbox/qcom,apcs-kpss-global.txt         | 24 ++++++++++++++---
 drivers/clk/qcom/apcs-msm8916.c               | 26 ++++++++++++++-----
 drivers/clk/qcom/clk-alpha-pll.c              |  8 ++++++
 drivers/clk/qcom/clk-alpha-pll.h              |  1 +
 drivers/clk/qcom/gcc-qcs404.c                 |  2 +-
 drivers/clk/qcom/hfpll.c                      | 21 +++++++++++++--
 6 files changed, 70 insertions(+), 12 deletions(-)

-- 
2.23.0

Comments

Stephen Boyd Dec. 19, 2019, 6:24 a.m. UTC | #1
Quoting Niklas Cassel (2019-11-25 05:59:05)
> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> 

> Make the output of the high frequency pll a clock provider.

> On the QCS404 this PLL controls cpu frequency scaling.

> 

> Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>

> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>

> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> Acked-by: Stephen Boyd <sboyd@kernel.org>

> ---


Applied to clk-next
Stephen Boyd Dec. 19, 2019, 6:25 a.m. UTC | #2
Quoting Niklas Cassel (2019-11-25 05:59:06)
> From: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> 

> When COMMON_CLK_DISABLED_UNUSED is set, in an effort to save power and

> to keep the software model of the clock in line with reality, the

> framework transverses the clock tree and disables those clocks that

> were enabled by the firmware but have not been enabled by any device

> driver.

> 

> If CPUFREQ is enabled, early during the system boot, it might attempt

> to change the CPU frequency ("set_rate"). If the HFPLL is selected as

> a provider, it will then change the rate for this clock.

> 

> As boot continues, clk_disable_unused_subtree will run. Since it wont

> find a valid counter (enable_count) for a clock that is actually

> enabled it will attempt to disable it which will cause the CPU to

> stop. Notice that in this driver, calls to check whether the clock is

> enabled are routed via the is_enabled callback which queries the

> hardware.

> 

> The following commit, rather than marking the clock critical and

> forcing the clock to be always enabled, addresses the above scenario

> making sure the clock is not disabled but it continues to rely on the

> firmware to enable the clock.

> 

> Co-developed-by: Niklas Cassel <niklas.cassel@linaro.org>

> Signed-off-by: Niklas Cassel <niklas.cassel@linaro.org>

> Signed-off-by: Jorge Ramirez-Ortiz <jorge.ramirez-ortiz@linaro.org>

> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>

> ---


Applied to clk-next
Stephen Boyd Dec. 30, 2019, 6:04 p.m. UTC | #3
Quoting Bjorn Andersson (2019-12-26 18:26:52)
> On Mon 23 Dec 18:16 PST 2019, Stephen Boyd wrote:

> 

> > Quoting Niklas Cassel (2019-12-20 09:56:16)

> > > On Wed, Dec 18, 2019 at 10:23:39PM -0800, Stephen Boyd wrote:

> > > > This is odd. The clks could be registered with of_clk_hw_register() but

> > > > then we lose the device provider information. Maybe we should search up

> > > > one level to the parent node and if that has a DT node but the

> > > > clk controller device doesn't we should use that instead?

> > > 

> > > Hello Stephen,

> > > 

> > > Having this in the clk core is totally fine with me,

> > > since it solves my problem.

> > > 

> > > Will you cook up a patch, or do you want me to do it?

> > > 

> > 

> > Can you try the patch I appended to my previous mail? I can write

> > something up more proper later this week.

> > 

> 

> Unfortunately we have clocks with no dev, so this fail as below. Adding

> a second check for dev != NULL to your oneliner works fine though.

> 

> I.e. this ugly hack works fine:

>   core->of_node = np ? : (dev ? dev_of_node(dev->parent) : NULL);

> 


Ok, thanks for testing!