Skip to content

Commit 5e9ab26

Browse files
committed
Merge tag 'pm-6.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management fixes from Rafael Wysocki: "These fix two issues in the amd-pstate cpufreq driver and update the intel_rapl power capping driver with a new processor ID. Specifics: - Enable ACPI CPPC in amd_pstate_register_driver() after disabling it in amd_pstate_unregister_driver() when switching driver operation modes (Dhananjay Ugwekar) - Make amd-pstate use nominal performance as the maximum performance level when boost is disabled (Mario Limonciello) - Add ArrowLake-H to the list of processors where PL4 is supported in the MSR part of the intel_rapl power capping driver (Srinivas Pandruvada)" * tag 'pm-6.12-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: powercap: intel_rapl_msr: Add PL4 support for ArrowLake-H cpufreq/amd-pstate: Use nominal perf for limits when boost is disabled cpufreq/amd-pstate: Fix amd_pstate mode switch on shared memory systems
2 parents 3b3a0ef + cf8679b commit 5e9ab26

File tree

2 files changed

+25
-6
lines changed

2 files changed

+25
-6
lines changed

drivers/cpufreq/amd-pstate.c

Lines changed: 24 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)
@@ -1201,11 +1206,21 @@ static int amd_pstate_register_driver(int mode)
12011206
return -EINVAL;
12021207

12031208
cppc_state = mode;
1209+
1210+
ret = amd_pstate_enable(true);
1211+
if (ret) {
1212+
pr_err("failed to enable cppc during amd-pstate driver registration, return %d\n",
1213+
ret);
1214+
amd_pstate_driver_cleanup();
1215+
return ret;
1216+
}
1217+
12041218
ret = cpufreq_register_driver(current_pstate_driver);
12051219
if (ret) {
12061220
amd_pstate_driver_cleanup();
12071221
return ret;
12081222
}
1223+
12091224
return 0;
12101225
}
12111226

@@ -1496,10 +1511,13 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
14961511
u64 value;
14971512
s16 epp;
14981513

1499-
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);
15001518
min_perf = READ_ONCE(cpudata->lowest_perf);
1501-
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
1502-
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);
15031521

15041522
if (min_limit_perf < min_perf)
15051523
min_limit_perf = min_perf;

drivers/powercap/intel_rapl_msr.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ static const struct x86_cpu_id pl4_support_ids[] = {
148148
X86_MATCH_VFM(INTEL_METEORLAKE, NULL),
149149
X86_MATCH_VFM(INTEL_METEORLAKE_L, NULL),
150150
X86_MATCH_VFM(INTEL_ARROWLAKE_U, NULL),
151+
X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL),
151152
{}
152153
};
153154

0 commit comments

Comments
 (0)