[PATCH v9 0/8] ACPI / cpufreq: CPPC: Preserve OSPM-set registers and add ospm_nominal_perf
From: Sumit Gupta
Date: Fri Nov 06 2026 - 14:34:30 EST
This series combines two series, as the second one builds on the first:
- Patches 1-5:
cpufreq: CPPC: Preserve OSPM-set registers across hotplug and
unload, v7 [1].
- Patches 6-8:
ACPI / cpufreq: CPPC: Add ospm_nominal_perf support, v8 [2].
There are no code changes from those versions. The series applies on
7.4-rc1.
Patches 1-5
-----------
These preserve the OSPM-set CPPC registers (Energy Performance
Preference, Autonomous Activity Window, Autonomous Selection - set via
sysfs) across CPU hotplug and suspend/resume. On driver unload, they put
back the values the registers had before the driver loaded.
To do this, the driver keeps the CPPC cpufreq policy alive across CPU
hotplug. It also orders the performance-control writes in
cppc_set_perf(), so that restoring them after a platform reset never
sends an invalid request.
Without online()/offline() callbacks, the core tears a policy down when
its last CPU goes offline and rebuilds it on the way back, re-reading the
CPPC capabilities each time. The values written to these registers can
be lost:
- Across CPU hotplug or suspend/resume: the platform may reset them
while the CPU is offline or suspended.
- On driver unload: the driver-written value is left in the register
instead of returning to its pre-driver state.
Handle these with:
- Patch 1: orders the Desired, MIN and MAX writes in cppc_set_perf(), so
that the platform never sees an invalid request.
- Patch 2: adds online()/offline() callbacks so the core keeps policy
alive across CPU hotplug instead of tearing it down and rebuilding it.
- Patch 3: makes the autonomous selection register helpers take a u64.
- Patch 4: saves each register's firmware value at init() and each
successful sysfs write as the requested value. offline() restores the
firmware values, and online() reapplies the requested values.
- Patch 5: extends the same restore and reapply to system
suspend/resume.
Patches 6-8
-----------
These add support for the OSPM Nominal Performance register (ACPI 6.6,
Section 8.4.6.1.2.6) to the CPPC ACPI and cpufreq drivers.
Unlike the read-only Nominal Performance register, OSPM Nominal
Performance is writable and lets OSPM request a nominal level below
the platform-reported nominal. The platform treats performance above
this level as boost and below as throttle.
- Patch 6: adds ACPI helpers to write the register and to check that
the platform supports it.
- Patch 7: adds the per-policy ospm_nominal_freq attribute in kHz. The
value is kept across CPU hotplug and suspend/resume. The register
cannot be read back, so a read returns the last value written.
- Patch 8: uses the OSPM nominal as the maximum frequency while boost
is off. Lowering the nominal creates a boost range on a platform
that has none, and boost can then be enabled.
v8 -> v9:
- Combine the two series into one. (Christian, Rafael)
- Rebase on 7.4-rc1.
- Add Christian's tags.
Christian Loehle (1):
ACPI: CPPC: Order performance-control updates
Sumit Gupta (7):
cpufreq: CPPC: Keep the policy across CPU hotplug
ACPI: CPPC: Make autonomous selection helpers take a u64
cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload
cpufreq: CPPC: Preserve OSPM-set registers across suspend/resume
ACPI: CPPC: Add ospm_nominal_perf support
cpufreq: CPPC: Add ospm_nominal_freq attribute
cpufreq: CPPC: Reflect the OSPM nominal in boost and limits
.../ABI/testing/sysfs-devices-system-cpu | 31 +
drivers/acpi/cppc_acpi.c | 362 +++++++--
drivers/cpufreq/amd-pstate.c | 2 +-
drivers/cpufreq/cppc_cpufreq.c | 689 ++++++++++++++++--
include/acpi/cppc_acpi.h | 19 +-
5 files changed, 970 insertions(+), 133 deletions(-)
[1] https://lore.kernel.org/lkml/20261030092416.1993889-1-sumitg@xxxxxxxxxx/
[2] https://lore.kernel.org/lkml/20261030172745.2045743-1-sumitg@xxxxxxxxxx/
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
--
2.34.1