mbox series

[0/5] Initialise thermal framework earlier during boot

Message ID cover.1568240476.git.amit.kucheria@linaro.org
Headers show
Series Initialise thermal framework earlier during boot | expand

Message

Amit Kucheria Sept. 11, 2019, 10:32 p.m. UTC
Device boot needs to be as fast as possible while keeping under the thermal
envelope. Now that thermal framework is built-in to the kernel, we can
initialize it earlier to enable thermal mitigation during boot.

We also need the cpufreq HW drivers to be initialised earlier to act as the
cooling devices. This series only converts over the qcom-hw driver to
initialize earlier but can be extended to other platforms as well.


Amit Kucheria (4):
  cpufreq: Initialise the governors in core_initcall
  cpufreq: Initialize cpufreq-dt driver earlier
  clk: qcom: Initialise clock drivers earlier
  cpufreq: qcom-hw: Move driver initialisation earlier

Lina Iyer (1):
  thermal: Initialize thermal subsystem earlier

 drivers/clk/qcom/clk-rpmh.c            |  2 +-
 drivers/clk/qcom/gcc-qcs404.c          |  2 +-
 drivers/clk/qcom/gcc-sdm845.c          |  2 +-
 drivers/cpufreq/cpufreq-dt-platdev.c   |  2 +-
 drivers/cpufreq/cpufreq_conservative.c |  2 +-
 drivers/cpufreq/cpufreq_ondemand.c     |  2 +-
 drivers/cpufreq/cpufreq_performance.c  |  2 +-
 drivers/cpufreq/cpufreq_powersave.c    |  2 +-
 drivers/cpufreq/cpufreq_userspace.c    |  2 +-
 drivers/cpufreq/qcom-cpufreq-hw.c      |  2 +-
 drivers/thermal/thermal_core.c         | 41 +++++++++++++++-----------
 11 files changed, 34 insertions(+), 27 deletions(-)

-- 
2.17.1

Comments

Daniel Lezcano Sept. 17, 2019, 12:48 p.m. UTC | #1
On 12/09/2019 00:32, Amit Kucheria wrote:
> Allow qcom-hw driver to initialise right after the cpufreq and thermal

> subsystems are initialised in core_initcall so we get earlier access to

> thermal mitigation.

> 

> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>


Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>


> ---

>  drivers/cpufreq/qcom-cpufreq-hw.c | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c

> index 4b0b50403901..04676cc82ba6 100644

> --- a/drivers/cpufreq/qcom-cpufreq-hw.c

> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c

> @@ -327,7 +327,7 @@ static int __init qcom_cpufreq_hw_init(void)

>  {

>  	return platform_driver_register(&qcom_cpufreq_hw_driver);

>  }

> -device_initcall(qcom_cpufreq_hw_init);

> +postcore_initcall(qcom_cpufreq_hw_init);

>  

>  static void __exit qcom_cpufreq_hw_exit(void)

>  {

> 



-- 
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
Sudeep Holla Sept. 17, 2019, 1:20 p.m. UTC | #2
On Tue, Sep 17, 2019 at 02:47:22PM +0200, Daniel Lezcano wrote:
>

> Hi Sudeep,

>

> On 17/09/2019 11:34, Sudeep Holla wrote:

> > On Thu, Sep 12, 2019 at 04:02:34AM +0530, Amit Kucheria wrote:

> >> Allow qcom-hw driver to initialise right after the cpufreq and thermal

> >> subsystems are initialised in core_initcall so we get earlier access to

> >> thermal mitigation.

> >>

> >> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>

> >> ---

> >>  drivers/cpufreq/qcom-cpufreq-hw.c | 2 +-

> >>  1 file changed, 1 insertion(+), 1 deletion(-)

> >>

> >> diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c

> >> index 4b0b50403901..04676cc82ba6 100644

> >> --- a/drivers/cpufreq/qcom-cpufreq-hw.c

> >> +++ b/drivers/cpufreq/qcom-cpufreq-hw.c

> >> @@ -327,7 +327,7 @@ static int __init qcom_cpufreq_hw_init(void)

> >>  {

> >>  	return platform_driver_register(&qcom_cpufreq_hw_driver);

> >>  }

> >> -device_initcall(qcom_cpufreq_hw_init);

> >> +postcore_initcall(qcom_cpufreq_hw_init);

> >

> > I am fine with core framework initcall pushed to earlier initcall levels

> > if required, but for individual/platform specific drivers I am not so

> > happy to see that.

> >

> > This goes against the grand plan of single common kernel strategy by

> > Android moving all drivers as modules. We might decide to make this

> > a module.

>

> module = mounted file system = very late initialization

>

> Is that the plan? Force every driver to load too late?

>


Yes. Something similar to what we have on desktops/servers.

> There are core drivers which must be loaded as soon as possible. If the

> qcom driver is one of them, then what is the problem?

>


I am fine with that if it's really issue but it shouldn't become the
defacto trend.

> "The grand plan" will have to solve this first before doing the module

> move.

>


Sure, I just expressed my view as it looks to be going in different
direction for me.

> > Also there are few cpufreq drivers that are modules. Will

> > they have issues ? If not, why do we need this change at all.

>

> Because some boards don't have thermal issues with the cpufreq drivers

> as module, other boards have.

>


OK, so this platform boots with default high OPP and needs thermal
mitigation that early ? If so, that's fine.

> > Needing

> > thermal mitigation during boot this earlier is still too much of

> > expectation, I would rather boot slowly than relying on this feature.

>

> And what if we want to boot faster? The boot time is one of a key point

> of benchmark.

>


I understand the requirement, though for me it's really sounds stupid.

As Quentin pointed out, it would be good to get all those benchmark
details, and preferably in the commit log so that we can look back
whenever someone else take the same approach later.

--
Regards,
Sudeep