Skip to content

Commit e9869c8

Browse files
dhananjay-AMDsuperm1
authored andcommitted
cpufreq/amd-pstate: Pass min/max_limit_perf as min/max_perf to amd_pstate_update
Currently, amd_pstate_update_freq passes the hardware perf limits as min/max_perf to amd_pstate_update, which eventually gets programmed into the min/max_perf fields of the CPPC_REQ register. Instead pass the effective perf limits i.e. min/max_limit_perf values to amd_pstate_update as min/max_perf. Signed-off-by: Dhananjay Ugwekar <dhananjay.ugwekar@amd.com> Reviewed-by: Mario Limonciello <mario.limonciello@amd.com> Reviewed-by: Gautham R. Shenoy <gautham.shenoy@amd.com> Link: https://lore.kernel.org/r/20250205112523.201101-6-dhananjay.ugwekar@amd.com Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
1 parent 932da64 commit e9869c8

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

drivers/cpufreq/amd-pstate.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,7 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
615615
{
616616
struct cpufreq_freqs freqs;
617617
struct amd_cpudata *cpudata = policy->driver_data;
618-
unsigned long max_perf, min_perf, des_perf, cap_perf;
618+
unsigned long des_perf, cap_perf;
619619

620620
if (!cpudata->max_freq)
621621
return -ENODEV;
@@ -624,8 +624,6 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
624624
amd_pstate_update_min_max_limit(policy);
625625

626626
cap_perf = READ_ONCE(cpudata->highest_perf);
627-
min_perf = READ_ONCE(cpudata->lowest_perf);
628-
max_perf = cap_perf;
629627

630628
freqs.old = policy->cur;
631629
freqs.new = target_freq;
@@ -642,8 +640,9 @@ static int amd_pstate_update_freq(struct cpufreq_policy *policy,
642640
if (!fast_switch)
643641
cpufreq_freq_transition_begin(policy, &freqs);
644642

645-
amd_pstate_update(cpudata, min_perf, des_perf,
646-
max_perf, fast_switch, policy->governor->flags);
643+
amd_pstate_update(cpudata, cpudata->min_limit_perf, des_perf,
644+
cpudata->max_limit_perf, fast_switch,
645+
policy->governor->flags);
647646

648647
if (!fast_switch)
649648
cpufreq_freq_transition_end(policy, &freqs, false);

0 commit comments

Comments
 (0)