Skip to content

Commit 2993b29

Browse files
committed
cpufreq/amd-pstate: Use boost numerator for upper bound of frequencies
commit 18d9b52 ("cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled") introduced different semantics for min/max limits based upon whether the user turned off boost from sysfs. This however is not necessary when the highest perf value is the boost numerator. Suggested-by: Dhananjay Ugwekar <Dhananjay.Ugwekar@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Fixes: 18d9b52 ("cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled") Link: https://lore.kernel.org/r/20241209185248.16301-3-mario.limonciello@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 50a062a commit 2993b29

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -570,16 +570,13 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy_data)
570570

571571
static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
572572
{
573-
u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf;
573+
u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf, max_freq;
574574
struct amd_cpudata *cpudata = policy->driver_data;
575575

576-
if (cpudata->boost_supported && !policy->boost_enabled)
577-
max_perf = READ_ONCE(cpudata->nominal_perf);
578-
else
579-
max_perf = READ_ONCE(cpudata->highest_perf);
580-
581-
max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
582-
min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
576+
max_perf = READ_ONCE(cpudata->highest_perf);
577+
max_freq = READ_ONCE(cpudata->max_freq);
578+
max_limit_perf = div_u64(policy->max * max_perf, max_freq);
579+
min_limit_perf = div_u64(policy->min * max_perf, max_freq);
583580

584581
lowest_perf = READ_ONCE(cpudata->lowest_perf);
585582
if (min_limit_perf < lowest_perf)

0 commit comments

Comments
 (0)