All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/4] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload
@ 2026-07-24 21:59 Sumit Gupta
  2026-07-24 21:59 ` [PATCH v3 1/4] cpufreq: CPPC: Keep the policy across CPU hotplug Sumit Gupta
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Sumit Gupta @ 2026-07-24 21:59 UTC (permalink / raw)
  To: rafael, viresh.kumar, pierre.gondois, christian.loehle,
	ionela.voinescu, zhenglifeng1, zhanjie9, lenb, saket.dumbre,
	ray.huang, mario.limonciello, perry.yuan, kprateek.nayak,
	linux-kernel, linux-pm, linux-acpi, acpica-devel, linux-tegra
  Cc: treding, jonathanh, vsethi, ksitaraman, sanjayc, mochs, bbasu,
	sumitg

This series keeps the CPPC cpufreq policy alive across CPU hotplug and
preserves the OSPM-set CPPC registers (Energy Performance Preference,
Autonomous Activity Window, Autonomous Selection) set via sysfs or the
autonomous boot parameter.

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.
 - 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: adds online()/offline() callbacks so the core keeps the policy
   alive across CPU hotplug instead of tearing it down and rebuilding it.
 - Patch 2: makes the autonomous selection register helpers take a u64.
 - Patch 3: adds a table-driven mechanism that captures each register's
   firmware value, restores it when the policy goes down, and reapplies
   the OSPM-set value when the policy comes back online.
 - Patch 4: extends the same save/restore to system suspend/resume.

v2[2] -> v3:
 - Patch 1: online() now re-establishes the desired/min/max tuple.
 - Patch 2: make cppc_get/set_auto_sel() take a u64 arg.
 - Patch 3: skip restoring/reapplying a reg whose value couldn't be read.
 - Patch 3: split save_req_and_restore_firmware_regs() so patch 4 can
   reuse save_requested_regs() for save-only suspend.
 - New patch 4: preserve the OSPM-set registers across suspend/resume.

Sumit Gupta (4):
  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

 drivers/acpi/cppc_acpi.c       |  20 +--
 drivers/cpufreq/amd-pstate.c   |   2 +-
 drivers/cpufreq/cppc_cpufreq.c | 223 ++++++++++++++++++++++++++++++++-
 include/acpi/cppc_acpi.h       |   8 +-
 4 files changed, 230 insertions(+), 23 deletions(-)

[1] v1: https://lore.kernel.org/lkml/20260623095403.3407436-1-sumitg@nvidia.com/
[2] v2: https://lore.kernel.org/lkml/20260716153820.2007095-1-sumitg@nvidia.com/

-- 
2.34.1


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

end of thread, other threads:[~2026-07-24 22:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-24 21:59 [PATCH v3 0/4] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload Sumit Gupta
2026-07-24 21:59 ` [PATCH v3 1/4] cpufreq: CPPC: Keep the policy across CPU hotplug Sumit Gupta
2026-07-24 21:59 ` [PATCH v3 2/4] ACPI: CPPC: Make autonomous selection helpers take a u64 Sumit Gupta
2026-07-24 21:59 ` [PATCH v3 3/4] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload Sumit Gupta
2026-07-24 21:59 ` [PATCH v3 4/4] cpufreq: CPPC: Preserve OSPM-set registers across suspend/resume Sumit Gupta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.