mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v9 0/8] ACPI / cpufreq: CPPC: Preserve OSPM-set registers and add ospm_nominal_perf
@ 2026-11-06 19:32 Sumit Gupta
  2026-11-06 19:32 ` [PATCH v9 1/8] ACPI: CPPC: Order performance-control updates Sumit Gupta
                   ` (7 more replies)
  0 siblings, 8 replies; 10+ messages in thread
From: Sumit Gupta @ 2026-11-06 19:32 UTC (permalink / raw)
  To: rafael, viresh.kumar, pierre.gondois, christian.loehle,
	ionela.voinescu, zhenglifeng1, zhanjie9, lenb, ray.huang,
	mario.limonciello, perry.yuan, kprateek.nayak,
	maciej.wieczor-retman, pawel.chmielewski, linux-pm, linux-acpi,
	acpica-devel, linux-kernel, linux-tegra
  Cc: treding, jonathanh, vsethi, ksitaraman, sanjayc, mochs, bbasu, sumitg

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@nvidia.com/
[2] https://lore.kernel.org/lkml/20261030172745.2045743-1-sumitg@nvidia.com/

base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.34.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2026-11-06 21:38 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 19:32 [PATCH v9 0/8] ACPI / cpufreq: CPPC: Preserve OSPM-set registers and add ospm_nominal_perf Sumit Gupta
2026-11-06 19:32 ` [PATCH v9 1/8] ACPI: CPPC: Order performance-control updates Sumit Gupta
2026-11-06 21:38   ` Sumit Gupta
2026-11-06 19:32 ` [PATCH v9 2/8] cpufreq: CPPC: Keep the policy across CPU hotplug Sumit Gupta
2026-11-06 19:32 ` [PATCH v9 3/8] ACPI: CPPC: Make autonomous selection helpers take a u64 Sumit Gupta
2026-11-06 19:33 ` [PATCH v9 4/8] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload Sumit Gupta
2026-11-06 19:33 ` [PATCH v9 5/8] cpufreq: CPPC: Preserve OSPM-set registers across suspend/resume Sumit Gupta
2026-11-06 19:33 ` [PATCH v9 6/8] ACPI: CPPC: Add ospm_nominal_perf support Sumit Gupta
2026-11-06 19:33 ` [PATCH v9 7/8] cpufreq: CPPC: Add ospm_nominal_freq attribute Sumit Gupta
2026-11-06 19:33 ` [PATCH v9 8/8] cpufreq: CPPC: Reflect the OSPM nominal in boost and limits Sumit Gupta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®