diff mbox series

[1/2] cpufreq: amd-pstate: Use CPUFREQ_POLICY_UNKNOWN

Message ID 20241211122605.3048503-2-christian.loehle@arm.com (mailing list archive)
State New
Headers show
Series cpufreq: Init epp_policy as CPUFREQ_POLICY_UNKNOWN | expand

Commit Message

Christian Loehle Dec. 11, 2024, 12:26 p.m. UTC
epp_policy uses the same values as cpufreq_policy.policy and resets
to CPUFREQ_POLICY_UNKNOWN during offlining. Be consistent about
it and initialize to CPUFREQ_POLICY_UNKNOWN instead of 0, too.

No functional change intended.

Cc: Huang Rui <ray.huang@amd.com>
Cc: <gautham.shenoy@amd.com>
Cc: Mario Limonciello <mario.limonciello@amd.com>
Cc: Perry Yuan <perry.yuan@amd.com>
Signed-off-by: Christian Loehle <christian.loehle@arm.com>
---
 drivers/cpufreq/amd-pstate.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mario Limonciello Dec. 11, 2024, 4:37 p.m. UTC | #1
On 12/11/2024 06:26, Christian Loehle wrote:
> epp_policy uses the same values as cpufreq_policy.policy and resets
> to CPUFREQ_POLICY_UNKNOWN during offlining. Be consistent about
> it and initialize to CPUFREQ_POLICY_UNKNOWN instead of 0, too.
> 
> No functional change intended.
> 
> Cc: Huang Rui <ray.huang@amd.com>
> Cc: <gautham.shenoy@amd.com>
> Cc: Mario Limonciello <mario.limonciello@amd.com>
> Cc: Perry Yuan <perry.yuan@amd.com>
> Signed-off-by: Christian Loehle <christian.loehle@arm.com>
> ---
>   drivers/cpufreq/amd-pstate.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index d7630bab2516..546e69cbdf76 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -1449,7 +1449,7 @@ static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
>   		return -ENOMEM;
>   
>   	cpudata->cpu = policy->cpu;
> -	cpudata->epp_policy = 0;
> +	cpudata->epp_policy = CPUFREQ_POLICY_UNKNOWN;
>   
>   	ret = amd_pstate_init_perf(cpudata);
>   	if (ret)

Hi,

Thanks for the patch.  In this case it's actually not needed though. 
Some of the in-flight content for 6.14 drops that variable.  This is on 
the superm1/linux.git bleeding-edge branch (which content will promote 
to superm1/linux.git linux-next branch soon and eventually come to 
linux-pm).

https://git.kernel.org/pub/scm/linux/kernel/git/superm1/linux.git/commit/?h=bleeding-edge&id=b8321230569dc17852a7f7adc7715ad07538cbeb
diff mbox series

Patch

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index d7630bab2516..546e69cbdf76 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -1449,7 +1449,7 @@  static int amd_pstate_epp_cpu_init(struct cpufreq_policy *policy)
 		return -ENOMEM;
 
 	cpudata->cpu = policy->cpu;
-	cpudata->epp_policy = 0;
+	cpudata->epp_policy = CPUFREQ_POLICY_UNKNOWN;
 
 	ret = amd_pstate_init_perf(cpudata);
 	if (ret)