mbox series

[v4,0/6] Initialise thermal framework and cpufreq earlier during boot

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

Message

Amit Kucheria Oct. 18, 2019, 8:51 a.m. UTC
Changes since v3:
- Init schedutil governor earlier too
- Simplified changes to thermal_init() error path
- Collects Acks

Changes since v2:
- Missed one patch when posting v2. Respinning.

Changes since v1:
- Completely get rid of netlink support in the thermal framework.
- This changes the early init patch to a single line - change to
  core_initcall. Changed authorship of patch since it is nothing like the
  original. Lina, let me know if you feel otherwise.
- I've tested to make sure that the qcom-cpufreq-hw driver continues to
  work correctly as a module so this won't impact Android's GKI plans.
- Collected Acks

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 (6):
  thermal: Remove netlink support
  thermal: Initialize thermal subsystem earlier
  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

 .../driver-api/thermal/sysfs-api.rst          |  26 +----
 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                | 103 +-----------------
 include/linux/thermal.h                       |  11 --
 kernel/sched/cpufreq_schedutil.c              |   2 +-
 14 files changed, 19 insertions(+), 143 deletions(-)

-- 
2.17.1

Comments

Viresh Kumar Oct. 18, 2019, 9:51 a.m. UTC | #1
On 18-10-19, 14:22, 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>

> Acked-by: Taniya Das <tdas@codeaurora.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 a9ae2f84a4efc..fc92a8842e252 100644

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

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

> @@ -334,7 +334,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)

>  {


Acked-by: Viresh Kumar <viresh.kumar@linaro.org>


-- 
viresh
Bjorn Andersson Nov. 13, 2019, 12:30 a.m. UTC | #2
On Fri 18 Oct 01:52 PDT 2019, 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>

> Acked-by: Taniya Das <tdas@codeaurora.org>


Hi Amit,

Booting linux-next on my db845c (and SDM850 laptop) I can see that the
device probes in /sys/bus/platform/drivers/qcom-cpufreq-hw, but
/sys/devices/system/cpu/cpufreq is empty.

Reverting this change gives me cpufreq back. Can you please have a look
at this?

Regards,
Bjorn

> ---

>  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 a9ae2f84a4efc..fc92a8842e252 100644

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

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

> @@ -334,7 +334,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)

>  {

> -- 

> 2.17.1

>