mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] [PATCH] cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail
@ 2025-01-10  9:12 Lifeng Zheng
  2025-01-10  9:17 ` zhenglifeng (A)
  0 siblings, 1 reply; 2+ messages in thread
From: Lifeng Zheng @ 2025-01-10  9:12 UTC (permalink / raw)
  To: rafael, viresh.kumar, mario.limonciello, perry.yuan
  Cc: linux-pm, linux-kernel, linuxarm, jonathan.cameron, zhanjie9,
	lihuisong, zhenglifeng1, fanghao11

Commit c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision
boost state") sets per-policy boost flag to false when boost fail.
However, this boost flag will be set to reverse value in
store_local_boost() and cpufreq_boost_trigger_state() in cpufreq.c. This
will cause the per-policy boost flag set to true when fail to set boost.
Remove the extra assignment in amd_pstate_set_boost() and keep all
operations on per-policy boost flag outside of set_boost() to fix this
problem.

Fixes: c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision boost state")
Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
---
 drivers/cpufreq/amd-pstate.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
index d7b1de97727a..a2573393ce30 100644
--- a/drivers/cpufreq/amd-pstate.c
+++ b/drivers/cpufreq/amd-pstate.c
@@ -747,7 +747,6 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
 	guard(mutex)(&amd_pstate_driver_lock);
 
 	ret = amd_pstate_cpu_boost_update(policy, state);
-	policy->boost_enabled = !ret ? state : false;
 	refresh_frequency_limits(policy);
 
 	return ret;
-- 
2.17.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] [PATCH] cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail
  2025-01-10  9:12 [PATCH] [PATCH] cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail Lifeng Zheng
@ 2025-01-10  9:17 ` zhenglifeng (A)
  0 siblings, 0 replies; 2+ messages in thread
From: zhenglifeng (A) @ 2025-01-10  9:17 UTC (permalink / raw)
  To: rafael, viresh.kumar, mario.limonciello, perry.yuan
  Cc: linux-pm, linux-kernel, linuxarm, jonathan.cameron, zhanjie9,
	lihuisong, fanghao11

On 2025/1/10 17:12, Lifeng Zheng wrote:
> Commit c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision
> boost state") sets per-policy boost flag to false when boost fail.
> However, this boost flag will be set to reverse value in
> store_local_boost() and cpufreq_boost_trigger_state() in cpufreq.c. This
> will cause the per-policy boost flag set to true when fail to set boost.
> Remove the extra assignment in amd_pstate_set_boost() and keep all
> operations on per-policy boost flag outside of set_boost() to fix this
> problem.
> 
> Fixes: c8c68c38b56f ("cpufreq: amd-pstate: initialize core precision boost state")
> Signed-off-by: Lifeng Zheng <zhenglifeng1@huawei.com>
> ---
>  drivers/cpufreq/amd-pstate.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/cpufreq/amd-pstate.c b/drivers/cpufreq/amd-pstate.c
> index d7b1de97727a..a2573393ce30 100644
> --- a/drivers/cpufreq/amd-pstate.c
> +++ b/drivers/cpufreq/amd-pstate.c
> @@ -747,7 +747,6 @@ static int amd_pstate_set_boost(struct cpufreq_policy *policy, int state)
>  	guard(mutex)(&amd_pstate_driver_lock);
>  
>  	ret = amd_pstate_cpu_boost_update(policy, state);
> -	policy->boost_enabled = !ret ? state : false;
>  	refresh_frequency_limits(policy);
>  
>  	return ret;

Got some mistakes, I'll resent another one. Sorry.😭

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-01-10  9:18 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-10  9:12 [PATCH] [PATCH] cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail Lifeng Zheng
2025-01-10  9:17 ` zhenglifeng (A)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®