Linux Tegra architecture development
 help / color / mirror / Atom feed
* [PATCH v2 0/3] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload
@ 2026-07-16 15:38 Sumit Gupta
  2026-07-16 15:38 ` [PATCH v2 1/3] cpufreq: CPPC: Keep the policy across CPU hotplug Sumit Gupta
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Sumit Gupta @ 2026-07-16 15:38 UTC (permalink / raw)
  To: rafael, viresh.kumar, pierre.gondois, ionela.voinescu,
	zhenglifeng1, zhanjie9, saket.dumbre, lenb, linux-kernel,
	linux-pm, linux-acpi, acpica-devel, linux-tegra
  Cc: treding, jonathanh, vsethi, ksitaraman, sanjayc, mochs, bbasu,
	sumitg

CPPC registers that OSPM programs at runtime, via sysfs (auto_sel,
energy_performance_preference, auto_act_window) or via the autonomous
mode boot parameter, can be silently lost across CPU hotplug or left
behind on driver unload:

 - Across CPU hotplug: the cpufreq core tears the policy down and the
   platform may reset the registers while the CPU is offline.
 - On driver unload: the value the driver wrote is left in the register
   instead of returning to its pre-driver state.

This series makes cppc_cpufreq keep these values consistent:

 - Patch 1: adds online()/offline() callbacks so core keeps the policy
   alive across CPU hotplug instead of tearing it down and rebuilding it.
 - Patch 2: adds u64 wrappers for the autonomous selection register.
 - 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.

v[1] -> v2:
 - New patch 1: keep policy across hotplug by adding online()/offline().
 - New patch 2: move the auto_sel u64 wrappers into cppc_acpi.c.
 - Restore fw values from offline(), which covers both hotplug and unload
 - Drop cppc_cache_perf_ctrls() and read reg values at offline() instead
   of caching them.
 - Add auto_act_window and defer OSPM Nominal Perf to a later series.

Sumit Gupta (3):
  cpufreq: CPPC: Keep the policy across CPU hotplug
  ACPI: CPPC: Add u64 wrappers for the autonomous selection register
  cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload

 drivers/acpi/cppc_acpi.c       |  40 +++++++++
 drivers/cpufreq/cppc_cpufreq.c | 156 +++++++++++++++++++++++++++++++++
 include/acpi/cppc_acpi.h       |  10 +++
 3 files changed, 206 insertions(+)

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

-- 
2.34.1


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

end of thread, other threads:[~2026-07-16 15:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-16 15:38 [PATCH v2 0/3] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload Sumit Gupta
2026-07-16 15:38 ` [PATCH v2 1/3] cpufreq: CPPC: Keep the policy across CPU hotplug Sumit Gupta
2026-07-16 15:38 ` [PATCH v2 2/3] ACPI: CPPC: Add u64 wrappers for the autonomous selection register Sumit Gupta
2026-07-16 15:38 ` [PATCH v2 3/3] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload Sumit Gupta

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