diff mbox series

[2/2] cpufreq: acpi: Mark boost policy as enabled when setting boost

Message ID 20240626041135.1559-3-mario.limonciello@amd.com (mailing list archive)
State Superseded, archived
Headers show
Series Fixes for boost enablement | expand

Commit Message

Mario Limonciello June 26, 2024, 4:11 a.m. UTC
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: Gautham R. Shenoy <gautham.shenoy@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
Cc: Sibi Sankar <quic_sibis@quicinc.com>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Dhruva Gole <d-gole@ti.com>
Cc: Yipeng Zou <zouyipeng@huawei.com>
Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
v14->v15:
 * Use Gautham's suggestion instead
---
 drivers/cpufreq/acpi-cpufreq.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Viresh Kumar June 26, 2024, 5:04 a.m. UTC | #1
On 25-06-24, 23:11, Mario Limonciello wrote:
> 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: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
> ---
> Cc: Sibi Sankar <quic_sibis@quicinc.com>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Dhruva Gole <d-gole@ti.com>
> Cc: Yipeng Zou <zouyipeng@huawei.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> v14->v15:
>  * Use Gautham's suggestion instead
> ---
>  drivers/cpufreq/acpi-cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 37f1cdf46d29..bd3f95a7a4fe 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -139,6 +139,7 @@ static int set_boost(struct cpufreq_policy *policy, int val)
>  			 (void *)(long)val, 1);
>  	pr_debug("CPU %*pbl: Core Boosting %s.\n",
>  		 cpumask_pr_args(policy->cpus), str_enabled_disabled(val));
> +	policy->boost_enabled = val;
>  
>  	return 0;
>  }

This is probably the wrong location to make this change as this
function gets called from cpufreq core too, which also sets the
policy->boost_enabled flag.

You should set this separately in the init() function itself after
set_boost() is called.
Gautham R.Shenoy June 26, 2024, 5:25 a.m. UTC | #2
Mario Limonciello <mario.limonciello@amd.com> writes:

> 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: Gautham R. Shenoy <gautham.shenoy@amd.com>
> Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>

Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com>

> ---
> Cc: Sibi Sankar <quic_sibis@quicinc.com>
> Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
> Cc: Viresh Kumar <viresh.kumar@linaro.org>
> Cc: Dhruva Gole <d-gole@ti.com>
> Cc: Yipeng Zou <zouyipeng@huawei.com>
> Cc: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> v14->v15:
>  * Use Gautham's suggestion instead
> ---
>  drivers/cpufreq/acpi-cpufreq.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
> index 37f1cdf46d29..bd3f95a7a4fe 100644
> --- a/drivers/cpufreq/acpi-cpufreq.c
> +++ b/drivers/cpufreq/acpi-cpufreq.c
> @@ -139,6 +139,7 @@ static int set_boost(struct cpufreq_policy *policy, int val)
>  			 (void *)(long)val, 1);
>  	pr_debug("CPU %*pbl: Core Boosting %s.\n",
>  		 cpumask_pr_args(policy->cpus), str_enabled_disabled(val));
> +	policy->boost_enabled = val;
>  
>  	return 0;
>  }
> -- 
> 2.43.0
diff mbox series

Patch

diff --git a/drivers/cpufreq/acpi-cpufreq.c b/drivers/cpufreq/acpi-cpufreq.c
index 37f1cdf46d29..bd3f95a7a4fe 100644
--- a/drivers/cpufreq/acpi-cpufreq.c
+++ b/drivers/cpufreq/acpi-cpufreq.c
@@ -139,6 +139,7 @@  static int set_boost(struct cpufreq_policy *policy, int val)
 			 (void *)(long)val, 1);
 	pr_debug("CPU %*pbl: Core Boosting %s.\n",
 		 cpumask_pr_args(policy->cpus), str_enabled_disabled(val));
+	policy->boost_enabled = val;
 
 	return 0;
 }