Message ID | 20191125135910.679310-1-niklas.cassel@linaro.org |
---|---|
Headers | show |
Series | Clock changes to support cpufreq on QCS404 | expand |
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
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
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!