Skip to content

Commit

Permalink
cpufreq: amd_pstate: fix wrong lowest perf fetch
Browse files Browse the repository at this point in the history
[ Upstream commit b185c50 ]

Fix the wrong lowest perf value reading which is used for new
des_perf calculation by governor requested, the incorrect min_perf will
get incorrect des_perf to be set , that will cause the system frequency
changing unexpectedly.

Reviewed-by: Huang Rui <ray.huang@amd.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
Signed-off-by: Su Jinzhou <jinzhou.su@amd.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Perry Yuan authored and gregkh committed Oct 21, 2022
1 parent 0994d9c commit 4720929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/cpufreq/amd-pstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ static int amd_pstate_target(struct cpufreq_policy *policy,
return -ENODEV;

cap_perf = READ_ONCE(cpudata->highest_perf);
min_perf = READ_ONCE(cpudata->lowest_nonlinear_perf);
min_perf = READ_ONCE(cpudata->lowest_perf);
max_perf = cap_perf;

freqs.old = policy->cur;
Expand Down

0 comments on commit 4720929

Please sign in to comment.