1

Power management updates for 6.12-rc4

- 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).
 -----BEGIN PGP SIGNATURE-----
 
 iQJGBAABCAAwFiEE4fcc61cGeeHD/fCwgsRv/nhiVHEFAmcSi7kSHHJqd0Byand5
 c29ja2kubmV0AAoJEILEb/54YlRxODYP/08cpRT/dgzXP1xVdouCd4CXrbCUzVDm
 QP2P+oNLvPkBo7Jc3S+jTbSAsmSidYUqNbYvEGMggsm9zhStW21n1Olz2z+P4k2c
 pzzU70Vmu42MxHJkbM+aMaluu/O9C3S3LGJAYWo3vPFSatRRUN6U/h9SWjwOslKd
 0uj9DhyTb0iL7kdrYsa974M9ZTL5xszYpoSsdIZWMUq2LqGqsrVNeK+o7zETw86i
 gSVv7l96Y3O3nXNTgG362ACNMOaCz7zL1hgQ3Kjp/6Y+SeK2JEMESDinJeCQDRAg
 CCaRJEpcRDKesBUADT+McRuWGt8KVtNObIk+IJeJzrQIZCztTOaLF7/ePjd2IkT7
 jkIwoc1Zw5LnPADUhn4+6w+gNmF/U9K2Mp5g3Y01OudEN1WDAWu+p+jr2PTD1w3A
 MUPC6Eo1BFeN0HZf//H52TI8fuZwCohQpbuCV2p814KnOKKWm6nZPi2OKPgC/I+r
 ljVp/8TB06KwZdmIcgmgqBX6jbghgMpKy6w1LCLrXPN/DWgeUWDBzO+NqpKZVFAP
 T8Di0RVv+QZJoIrilpKK2SnI1Rwfv6TOCB+lKPmsRxm+/OYgIhVsQFl+7fWI46DN
 a6+4v3yMZcc0Y1C18PKPxGpzcif6SOkJ6fChjZ7ddf4qsijaurS/kmDIkTPcOdXj
 SymbawvS/1dT
 =a0Z8
 -----END PGP SIGNATURE-----

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
This commit is contained in:
Linus Torvalds 2024-10-18 11:16:01 -07:00
commit 5e9ab267be
2 changed files with 25 additions and 6 deletions

View File

@ -536,11 +536,16 @@ static int amd_pstate_verify(struct cpufreq_policy_data *policy)
static int amd_pstate_update_min_max_limit(struct cpufreq_policy *policy)
{
u32 max_limit_perf, min_limit_perf, lowest_perf;
u32 max_limit_perf, min_limit_perf, lowest_perf, max_perf;
struct amd_cpudata *cpudata = policy->driver_data;
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
if (cpudata->boost_supported && !policy->boost_enabled)
max_perf = READ_ONCE(cpudata->nominal_perf);
else
max_perf = READ_ONCE(cpudata->highest_perf);
max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
lowest_perf = READ_ONCE(cpudata->lowest_perf);
if (min_limit_perf < lowest_perf)
@ -1201,11 +1206,21 @@ static int amd_pstate_register_driver(int mode)
return -EINVAL;
cppc_state = mode;
ret = amd_pstate_enable(true);
if (ret) {
pr_err("failed to enable cppc during amd-pstate driver registration, return %d\n",
ret);
amd_pstate_driver_cleanup();
return ret;
}
ret = cpufreq_register_driver(current_pstate_driver);
if (ret) {
amd_pstate_driver_cleanup();
return ret;
}
return 0;
}
@ -1496,10 +1511,13 @@ static int amd_pstate_epp_update_limit(struct cpufreq_policy *policy)
u64 value;
s16 epp;
max_perf = READ_ONCE(cpudata->highest_perf);
if (cpudata->boost_supported && !policy->boost_enabled)
max_perf = READ_ONCE(cpudata->nominal_perf);
else
max_perf = READ_ONCE(cpudata->highest_perf);
min_perf = READ_ONCE(cpudata->lowest_perf);
max_limit_perf = div_u64(policy->max * cpudata->highest_perf, cpudata->max_freq);
min_limit_perf = div_u64(policy->min * cpudata->highest_perf, cpudata->max_freq);
max_limit_perf = div_u64(policy->max * max_perf, policy->cpuinfo.max_freq);
min_limit_perf = div_u64(policy->min * max_perf, policy->cpuinfo.max_freq);
if (min_limit_perf < min_perf)
min_limit_perf = min_perf;

View File

@ -148,6 +148,7 @@ static const struct x86_cpu_id pl4_support_ids[] = {
X86_MATCH_VFM(INTEL_METEORLAKE, NULL),
X86_MATCH_VFM(INTEL_METEORLAKE_L, NULL),
X86_MATCH_VFM(INTEL_ARROWLAKE_U, NULL),
X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL),
{}
};