cpufreq: Allow drivers to advertise boost enabled
PATCH v2 1/2 cpufreq: Allow drivers to advertise boost enabled
The behavior introduced in commit f37a4d6b4a2c ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()") sets up the boost policy incorrectly when boost has been enabled by the platform firmware initially even if a driver sets the policy up.
This is because policy_has_boost_freq() assumes that there is a frequency table set up by the driver and that the boost frequencies are advertised in that table. This assumption doesn't work for acpi-cpufreq or amd-pstate. Only use this check to enable boost if it's not already enabled instead of also disabling it if alreayd enabled.
---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]> v1->v2
* Pick up tags
--- drivers/cpufreq/cpufreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/cpufreq/cpufreq.c +2 -1
@@ -1430,7 +1430,8 @@ static int cpufreq_online(unsigned int cpu) }/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - policy->boost_enabled =cpufreq_boost_enabled () &&policy_has_boost_freq (policy); +if (cpufreq_boost_enabled () &&policy_has_boost_freq (policy)) + policy->boost_enabled = true;/* * The initialization has succeeded and the policy is online.
Signature · 1 line
2.43.0
PATCH v2 2/2 cpufreq: acpi: Mark boost policy as enabled when setting boost
When boost is set for CPUs using acpi-cpufreq the policy is not updated which can cause boost to be incorrectly not reported.
---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]> v1->v2:
* Move to init as suggested by Viresh
--- drivers/cpufreq/acpi-cpufreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/cpufreq/acpi-cpufreq.c +3 -1
@@ -888,8 +888,10 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)if (perf->states[0 ].core_frequency *1000 != freq_table[0 ].frequency)pr_warn (FW_WARN "P-state 0 is not max freq\n" ); -if (acpi_cpufreq_driver.set_boost) +if (acpi_cpufreq_driver.set_boost) {set_boost (policy, acpi_cpufreq_driver.boost_enabled); + policy->boost_enabled = acpi_cpufreq_driver.boost_enabled; + }return result;
Signature · 1 line
2.43.0
Re: [PATCH v2 2/2] cpufreq: acpi: Mark boost policy as enabled when setting boost
Quoted 6 lines · Mario Limonciello
When boost is set for CPUs using acpi-cpufreq the policy is not updated which can cause boost to be incorrectly not reported.
Suggested-by Viresh Kumar <[email protected]>Suggested-by Gautham R. Shenoy <[email protected]>Signed-off-by Mario Limonciello <[email protected]>
Quoted 9 lines
---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>v1->v2:
* Move to init as suggested by Viresh
Quoted 22 lines
--- drivers/cpufreq/acpi-cpufreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/cpufreq/acpi-cpufreq.c +3
-1@@ -888,8 +888,10 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)if (perf->states[0 ].core_frequency *1000 != freq_table[0 ].frequency)pr_warn (FW_WARN "P-state 0 is not max freq\n" ); -if (acpi_cpufreq_driver.set_boost) +if (acpi_cpufreq_driver.set_boost) {set_boost (policy, acpi_cpufreq_driver.boost_enabled); + policy->boost_enabled = acpi_cpufreq_driver.boost_enabled; + }return result;Signature · 1 line
2.43.0
Re: [PATCH v2 2/2] cpufreq: acpi: Mark boost policy as enabled when setting boost
In reply to Mario LimoncielloQuoted 6 lines · Mario Limonciello
When boost is set for CPUs using acpi-cpufreq the policy is not updated which can cause boost to be incorrectly not reported.
Suggested-by Viresh Kumar <[email protected]>Suggested-by Gautham R. Shenoy <[email protected]>Signed-off-by Mario Limonciello <[email protected]>
Quoted 7 lines
---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>
The below version log needs to go ...
Quoted 3 lines
v1->v2:
* Move to init as suggested by Viresh
---
... here.
Quoted 8 lines
drivers/cpufreq/acpi-cpufreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/cpufreq/acpi-cpufreq.c +0
-0
drivers/cpufreq/acpi-cpufreq.c static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy) · line 896
Quoted 10 lines
drivers/cpufreq/acpi-cpufreq.c +3
-1@@ -888,8 +888,10 @@ static int acpi_cpufreq_cpu_init(struct cpufreq_policy *policy)if (perf->states[0 ].core_frequency *1000 != freq_table[0 ].frequency)pr_warn (FW_WARN "P-state 0 is not max freq\n" ); -if (acpi_cpufreq_driver.set_boost) +if (acpi_cpufreq_driver.set_boost) {set_boost (policy, acpi_cpufreq_driver.boost_enabled); + policy->boost_enabled = acpi_cpufreq_driver.boost_enabled; + }return result;
Signature · 1 line
viresh
Rafael J. Wysocki
maintainerQuoted 12 lines · Mario Limonciello
The behavior introduced in commit
f37a4d6b4a2c("cpufreq: Fix per-policy boost behavior on SoCs usingcpufreq_boost_set_sw()") sets up the boost policy incorrectly when boost has been enabled by the platform firmware initially even if a driver sets the policy up.This is because
policy_has_boost_freq()assumes that there is a frequency table set up by the driver and that the boost frequencies are advertised in that table. This assumption doesn't work for acpi-cpufreq or amd-pstate. Only use this check to enable boost if it's not already enabled instead of also disabling it if alreayd enabled.
Quoted 5 lines
Reviewed-by Sibi Sankar <[email protected]>Reviewed-by Dhruva Gole <[email protected]>Acked-by Viresh Kumar <[email protected]>Reviewed-by Gautham R. Shenoy <[email protected]>Fixes f37a4d6b4a2c ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()")
Quoted 31 lines
Suggested-by Viresh Kumar <[email protected]>Suggested-by Gautham R. Shenoy <[email protected]>Signed-off-by Mario Limonciello <[email protected]>---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>v1->v2
* Pick up tags--- drivers/cpufreq/cpufreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/cpufreq/cpufreq.c +2
-2@@ -1430,7 +1430,8 @@ static int cpufreq_online(unsigned int cpu) }/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - policy->boost_enabled =cpufreq_boost_enabled () &&policy_has_boost_freq (policy); +if (cpufreq_boost_enabled () &&policy_has_boost_freq (policy)) + policy->boost_enabled = true;/* * The initialization has succeeded and the policy is online. --
Quoted 14 lines · Rafael J. Wysocki
Quoted 12 lines · Mario Limonciello
The behavior introduced in commit
f37a4d6b4a2c("cpufreq: Fix per-policy boost behavior on SoCs usingcpufreq_boost_set_sw()") sets up the boost policy incorrectly when boost has been enabled by the platform firmware initially even if a driver sets the policy up.This is because
policy_has_boost_freq()assumes that there is a frequency table set up by the driver and that the boost frequencies are advertised in that table. This assumption doesn't work for acpi-cpufreq or amd-pstate. Only use this check to enable boost if it's not already enabled instead of also disabling it if alreayd enabled.
Quoted 7 lines
Quoted 5 lines
Reviewed-by Sibi Sankar <[email protected]>Reviewed-by Dhruva Gole <[email protected]>Acked-by Viresh Kumar <[email protected]>Reviewed-by Gautham R. Shenoy <[email protected]>Fixes f37a4d6b4a2c ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()")CC stable I suppose?
Yes, I didn't realize f37a4d6b4a2c came in 6.9, I had assumed it was 6.10. But since it's 6.9, yes if you can please add stable tag when committing.
Quoted 32 lines
Quoted 32 lines
Suggested-by Viresh Kumar <[email protected]>Suggested-by Gautham R. Shenoy <[email protected]>Signed-off-by Mario Limonciello <[email protected]>---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>v1->v2
* Pick up tags--- drivers/cpufreq/cpufreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/cpufreq/cpufreq.c +2
-2@@ -1430,7 +1430,8 @@ static int cpufreq_online(unsigned int cpu) }/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - policy->boost_enabled =cpufreq_boost_enabled () &&policy_has_boost_freq (policy); +if (cpufreq_boost_enabled () &&policy_has_boost_freq (policy)) + policy->boost_enabled = true;/* * The initialization has succeeded and the policy is online. --
Quoted 22 lines · Mario Limonciello
Quoted 20 lines · Rafael J. Wysocki
Quoted 17 lines · Mario Limonciello
The behavior introduced in commit
f37a4d6b4a2c("cpufreq: Fix per-policy boost behavior on SoCs usingcpufreq_boost_set_sw()") sets up the boost policy incorrectly when boost has been enabled by the platform firmware initially even if a driver sets the policy up.This is because
policy_has_boost_freq()assumes that there is a frequency table set up by the driver and that the boost frequencies are advertised in that table. This assumption doesn't work for acpi-cpufreq or amd-pstate. Only use this check to enable boost if it's not already enabled instead of also disabling it if alreayd enabled.Reviewed-by Sibi Sankar <[email protected]>Reviewed-by Dhruva Gole <[email protected]>Acked-by Viresh Kumar <[email protected]>Reviewed-by Gautham R. Shenoy <[email protected]>Fixes f37a4d6b4a2c ("cpufreq: Fix per-policy boost behavior on SoCs using cpufreq_boost_set_sw()")
Quoted 5 lines
Quoted 1 line
CC stable I suppose?Yes, I didn't realize
f37a4d6b4a2ccame in 6.9, I had assumed it was 6.10. But since it's 6.9, yes if you can please add stable tag when committing.
Applied as 6.10-rc material along with the [2/2].
I've added a Fixes: tag to the second patch and "Cc: stable" tags to both patches.
Thanks!
Quoted 33 lines
Quoted 32 lines
Quoted 32 lines
Suggested-by Viresh Kumar <[email protected]>Suggested-by Gautham R. Shenoy <[email protected]>Signed-off-by Mario Limonciello <[email protected]>---
Cc: Sibi Sankar <[email protected]>
Cc: Dietmar Eggemann <[email protected]>
Cc: Viresh Kumar <[email protected]>
Cc: Dhruva Gole <[email protected]>
Cc: Yipeng Zou <[email protected]>
Cc: Rafael J. Wysocki <[email protected]>v1->v2
* Pick up tags--- drivers/cpufreq/cpufreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)drivers/cpufreq/cpufreq.c +2
-2@@ -1430,7 +1430,8 @@ static int cpufreq_online(unsigned int cpu) }/* Let the per-policy boost flag mirror the cpufreq_driver boost during init */ - policy->boost_enabled =cpufreq_boost_enabled () &&policy_has_boost_freq (policy); +if (cpufreq_boost_enabled () &&policy_has_boost_freq (policy)) + policy->boost_enabled = true;/* * The initialization has succeeded and the policy is online. --