* [PATCH v2 1/5] thermal: Initialize thermal subsystem earlier
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
@ 2019-10-17 10:30 ` Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 2/5] cpufreq: Initialise the governors in core_initcall Amit Kucheria
` (4 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 10:30 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, daniel.lezcano, viresh.kumar,
sudeep.holla, bjorn.andersson, edubezval, agross, tdas, swboyd,
ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-pm
Now that the thermal framework is built-in, in order to facilitate
thermal mitigation as early as possible in the boot cycle, move the
thermal framework initialization to core_initcall.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
drivers/thermal/thermal_core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index d21b754baee2..d8251d723459 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -1537,4 +1537,5 @@ static int __init thermal_init(void)
mutex_destroy(&poweroff_lock);
return result;
}
-fs_initcall(thermal_init);
+
+core_initcall(thermal_init);
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 2/5] cpufreq: Initialise the governors in core_initcall
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 1/5] thermal: Initialize thermal subsystem earlier Amit Kucheria
@ 2019-10-17 10:30 ` Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 3/5] cpufreq: Initialize cpufreq-dt driver earlier Amit Kucheria
` (3 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 10:30 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, daniel.lezcano, viresh.kumar,
sudeep.holla, bjorn.andersson, edubezval, agross, tdas, swboyd,
ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-pm
Initialise the cpufreq governors earlier to allow for earlier
performance control during the boot process.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
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 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c
index b66e81c06a57..737ff3b9c2c0 100644
--- a/drivers/cpufreq/cpufreq_conservative.c
+++ b/drivers/cpufreq/cpufreq_conservative.c
@@ -346,7 +346,7 @@ struct cpufreq_governor *cpufreq_default_governor(void)
return CPU_FREQ_GOV_CONSERVATIVE;
}
-fs_initcall(cpufreq_gov_dbs_init);
+core_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
index dced033875bf..82a4d37ddecb 100644
--- a/drivers/cpufreq/cpufreq_ondemand.c
+++ b/drivers/cpufreq/cpufreq_ondemand.c
@@ -483,7 +483,7 @@ struct cpufreq_governor *cpufreq_default_governor(void)
return CPU_FREQ_GOV_ONDEMAND;
}
-fs_initcall(cpufreq_gov_dbs_init);
+core_initcall(cpufreq_gov_dbs_init);
#else
module_init(cpufreq_gov_dbs_init);
#endif
diff --git a/drivers/cpufreq/cpufreq_performance.c b/drivers/cpufreq/cpufreq_performance.c
index aaa04dfcacd9..def9afe0f5b8 100644
--- a/drivers/cpufreq/cpufreq_performance.c
+++ b/drivers/cpufreq/cpufreq_performance.c
@@ -50,5 +50,5 @@ MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>");
MODULE_DESCRIPTION("CPUfreq policy governor 'performance'");
MODULE_LICENSE("GPL");
-fs_initcall(cpufreq_gov_performance_init);
+core_initcall(cpufreq_gov_performance_init);
module_exit(cpufreq_gov_performance_exit);
diff --git a/drivers/cpufreq/cpufreq_powersave.c b/drivers/cpufreq/cpufreq_powersave.c
index c143dc237d87..1ae66019eb83 100644
--- a/drivers/cpufreq/cpufreq_powersave.c
+++ b/drivers/cpufreq/cpufreq_powersave.c
@@ -43,7 +43,7 @@ struct cpufreq_governor *cpufreq_default_governor(void)
return &cpufreq_gov_powersave;
}
-fs_initcall(cpufreq_gov_powersave_init);
+core_initcall(cpufreq_gov_powersave_init);
#else
module_init(cpufreq_gov_powersave_init);
#endif
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c
index cbd81c58cb8f..b43e7cd502c5 100644
--- a/drivers/cpufreq/cpufreq_userspace.c
+++ b/drivers/cpufreq/cpufreq_userspace.c
@@ -147,7 +147,7 @@ struct cpufreq_governor *cpufreq_default_governor(void)
return &cpufreq_gov_userspace;
}
-fs_initcall(cpufreq_gov_userspace_init);
+core_initcall(cpufreq_gov_userspace_init);
#else
module_init(cpufreq_gov_userspace_init);
#endif
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 3/5] cpufreq: Initialize cpufreq-dt driver earlier
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 1/5] thermal: Initialize thermal subsystem earlier Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 2/5] cpufreq: Initialise the governors in core_initcall Amit Kucheria
@ 2019-10-17 10:30 ` Amit Kucheria
2019-10-17 10:30 ` [PATCH v2 4/5] clk: qcom: Initialise clock drivers earlier Amit Kucheria
` (2 subsequent siblings)
5 siblings, 0 replies; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 10:30 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, daniel.lezcano, viresh.kumar,
sudeep.holla, bjorn.andersson, edubezval, agross, tdas, swboyd,
ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-pm
This allows HW drivers that depend on cpufreq-dt to initialise earlier.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq-dt-platdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index bca8d1f47fd2..3282defe14d4 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -180,4 +180,4 @@ static int __init cpufreq_dt_platdev_init(void)
-1, data,
sizeof(struct cpufreq_dt_platform_data)));
}
-device_initcall(cpufreq_dt_platdev_init);
+core_initcall(cpufreq_dt_platdev_init);
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH v2 4/5] clk: qcom: Initialise clock drivers earlier
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
` (2 preceding siblings ...)
2019-10-17 10:30 ` [PATCH v2 3/5] cpufreq: Initialize cpufreq-dt driver earlier Amit Kucheria
@ 2019-10-17 10:30 ` Amit Kucheria
2019-10-17 17:46 ` Stephen Boyd
2019-10-17 10:30 ` [PATCH v2 5/5] cpufreq: qcom-hw: Move driver initialisation earlier Amit Kucheria
2019-10-17 12:17 ` [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
5 siblings, 1 reply; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 10:30 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, daniel.lezcano, viresh.kumar,
sudeep.holla, bjorn.andersson, edubezval, agross, tdas, swboyd,
ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-clk
Initialise the clock drivers on sdm845 and qcs404 in core_initcall so we
can have earlier access to cpufreq during booting.
Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
---
drivers/clk/qcom/clk-rpmh.c | 2 +-
drivers/clk/qcom/gcc-qcs404.c | 2 +-
drivers/clk/qcom/gcc-sdm845.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/clk/qcom/clk-rpmh.c b/drivers/clk/qcom/clk-rpmh.c
index 96a36f6ff667..20d4258f125b 100644
--- a/drivers/clk/qcom/clk-rpmh.c
+++ b/drivers/clk/qcom/clk-rpmh.c
@@ -487,7 +487,7 @@ static int __init clk_rpmh_init(void)
{
return platform_driver_register(&clk_rpmh_driver);
}
-subsys_initcall(clk_rpmh_init);
+core_initcall(clk_rpmh_init);
static void __exit clk_rpmh_exit(void)
{
diff --git a/drivers/clk/qcom/gcc-qcs404.c b/drivers/clk/qcom/gcc-qcs404.c
index bd32212f37e6..9b0c4ce2ef4e 100644
--- a/drivers/clk/qcom/gcc-qcs404.c
+++ b/drivers/clk/qcom/gcc-qcs404.c
@@ -2855,7 +2855,7 @@ static int __init gcc_qcs404_init(void)
{
return platform_driver_register(&gcc_qcs404_driver);
}
-subsys_initcall(gcc_qcs404_init);
+core_initcall(gcc_qcs404_init);
static void __exit gcc_qcs404_exit(void)
{
diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
index 95be125c3bdd..49dcff1af2db 100644
--- a/drivers/clk/qcom/gcc-sdm845.c
+++ b/drivers/clk/qcom/gcc-sdm845.c
@@ -3628,7 +3628,7 @@ static int __init gcc_sdm845_init(void)
{
return platform_driver_register(&gcc_sdm845_driver);
}
-subsys_initcall(gcc_sdm845_init);
+core_initcall(gcc_sdm845_init);
static void __exit gcc_sdm845_exit(void)
{
--
2.17.1
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 4/5] clk: qcom: Initialise clock drivers earlier
2019-10-17 10:30 ` [PATCH v2 4/5] clk: qcom: Initialise clock drivers earlier Amit Kucheria
@ 2019-10-17 17:46 ` Stephen Boyd
0 siblings, 0 replies; 8+ messages in thread
From: Stephen Boyd @ 2019-10-17 17:46 UTC (permalink / raw)
To: Rafael J. Wysocki, Amit Kucheria, Amit Kucheria, Zhang Rui,
agross, bjorn.andersson, daniel.lezcano, edubezval, ilina,
linux-arm-msm, linux-kernel, sudeep.holla, tdas, viresh.kumar
Cc: linux-clk
Quoting Amit Kucheria (2019-10-17 03:30:53)
> Initialise the clock drivers on sdm845 and qcs404 in core_initcall so we
> can have earlier access to cpufreq during booting.
>
> Signed-off-by: Amit Kucheria <amit.kucheria@linaro.org>
> ---
Acked-by: Stephen Boyd <sboyd@kernel.org>
Makes me sad though.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 5/5] cpufreq: qcom-hw: Move driver initialisation earlier
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
` (3 preceding siblings ...)
2019-10-17 10:30 ` [PATCH v2 4/5] clk: qcom: Initialise clock drivers earlier Amit Kucheria
@ 2019-10-17 10:30 ` Amit Kucheria
2019-10-17 12:17 ` [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
5 siblings, 0 replies; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 10:30 UTC (permalink / raw)
To: linux-kernel, linux-arm-msm, daniel.lezcano, viresh.kumar,
sudeep.holla, bjorn.andersson, edubezval, agross, tdas, swboyd,
ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-pm
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 a9ae2f84a4ef..fc92a8842e25 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
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot
2019-10-17 10:30 [PATCH v2 0/5] Initialise thermal framework and cpufreq earlier during boot Amit Kucheria
` (4 preceding siblings ...)
2019-10-17 10:30 ` [PATCH v2 5/5] cpufreq: qcom-hw: Move driver initialisation earlier Amit Kucheria
@ 2019-10-17 12:17 ` Amit Kucheria
5 siblings, 0 replies; 8+ messages in thread
From: Amit Kucheria @ 2019-10-17 12:17 UTC (permalink / raw)
To: LKML, linux-arm-msm, Daniel Lezcano, Viresh Kumar, Sudeep Holla,
Bjorn Andersson, Eduardo Valentin, Andy Gross, Taniya Das,
Stephen Boyd, ilina, Rafael J. Wysocki, Amit Kucheria, Zhang Rui
Cc: linux-clk, Linux PM list
This is embarassing. I generated this series incorrectly. It is
missing a patch removing netlink support. v3 coming right up.
Sorry for the noise.
On Thu, Oct 17, 2019 at 4:00 PM Amit Kucheria <amit.kucheria@linaro.org> wrote:
>
> 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 (5):
> 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
>
> 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 | 3 ++-
> 11 files changed, 12 insertions(+), 11 deletions(-)
>
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 8+ messages in thread