Skip to content

Commit 702dedf

Browse files
committed
Merge tag 'amd-pstate-v6.12-2024-10-16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux
Merge an amd-pstate driver fix for 6.12-rc4 from Mario Limonciello: "Fix a regression introduced where boost control malfunctioned in amd-pstate" * tag 'amd-pstate-v6.12-2024-10-16' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/superm1/linux: cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled
2 parents 940efc9 + 18d9b52 commit 702dedf

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -536,11 +536,16 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy)
536536

537537
static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
538538
{
539-
u32 max_limit_perf, min_limit_perf, lowest_perf;
539+
u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf;
540540
struct amd_cpudata *cpudata = policy->driver_data;
541541

542-
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
543-
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
542+
if (cpudata->boost_supported && !policy->boost_enabled)
543+
max_perf = READ_ONCE(cpudata->nominal_perf);
544+
else
545+
max_perf = READ_ONCE(cpudata->highest_perf);
546+
547+
max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
548+
min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
544549

545550
lowest_perf = READ_ONCE(cpudata->lowest_perf);
546551
if (min_limit_perf < lowest_perf)
@@ -1506,10 +1511,13 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
15061511
u64 value;
15071512
s16 epp;
15081513

1509-
max_perf = READ_ONCE(cpudata->highest_perf);
1514+
if (cpudata->boost_supported && !policy->boost_enabled)
1515+
max_perf = READ_ONCE(cpudata->nominal_perf);
1516+
else
1517+
max_perf = READ_ONCE(cpudata->highest_perf);
15101518
min_perf = READ_ONCE(cpudata->lowest_perf);
1511-
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
1512-
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
1519+
max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
1520+
min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
15131521

15141522
if (min_limit_perf < min_perf)
15151523
min_limit_perf = min_perf;

0 commit comments

Comments
 (0)