]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
cpufreq/amd-pstate: Fix per-policy boost flag incorrect when fail
authorLifeng Zheng <zhenglifeng1@huawei.com>
Fri, 10 Jan 2025 09:19:49 +0000 (17:19 +0800)
committerMario Limonciello <mario.limonciello@amd.com>
Mon, 3 Feb 2025 06:04:23 +0000 (00:04 -0600)
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>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Link: https://lore.kernel.org/r/20250110091949.3610770-1-zhenglifeng1@huawei.com
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
drivers/cpufreq/amd-pstate.c

index dd9b8d6993d695decd271901dd751584398fde2b..7120f035c0be454f3a6fe9867f33d723e798c5e6 100644 (file)
@@ -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;