Linux driver-core infrastructure
 help / color / mirror / Atom feed
* [PATCH v5 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime
@ 2026-08-07  6:08 Xueqin Luo
  2026-08-07  6:08 ` [PATCH v5 1/3] cpufreq: cppc: Add update_limits support for Highest Performance changes Xueqin Luo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Xueqin Luo @ 2026-08-07  6:08 UTC (permalink / raw)
  To: Sudeep Holla, Greg Kroah-Hartman, Rafael J . Wysocki,
	Danilo Krummrich, Viresh Kumar
  Cc: Jie Zhan, Lifeng Zheng, Pierre Gondois, Sumit Gupta, linux-kernel,
	driver-core, linux-pm, Xueqin Luo

Hi Rafael, Pierre,

This series adds support for handling ACPI CPPC Highest Performance
register changes at runtime, triggered by Notify(0x85) on a processor
device.

When the platform changes the Highest Performance value (e.g. due to
thermal or power budget adjustments), the OSPM must re-evaluate the
cached capability and propagate the change to the cpufreq policy,
the scheduler's CPU capacity model, and the frequency invariance
engine.

The series is split into three patches:
  Patch 1: Core update_limits callback with boost QoS handling.
  Patch 2: Refactor autonomous perf bounds into a reusable helper
           and wire it into update_limits with error logging.
  Patch 3: Topology subsystem runtime capacity updates with
           validation, early-return optimization, and concurrent-safe
           normalization.

v4 -> v5:
  - Move cpu_data and caps pointer assignments after
    guard(cpufreq_policy_write) in cppc_cpufreq_update_limits() to
    avoid potential use-after-free if concurrent CPU offline frees
    driver_data before the lock is acquired (Sashiko)
  - Extract cppc_cpufreq_sync_boost_limits() from update_limits to
    handle boost_supported re-evaluation, cpuinfo.max_freq tracking,
    and boost_freq_req QoS update in a dedicated helper. The helper
    always updates the QoS request (even when boost becomes
    unsupported) to clear stale constraint values, and forcibly
    disables boost_enabled when boost disappears at runtime
  - Add highest_perf validation in topology_update_cpu_capacity():
    reject values below lowest_perf to prevent corrupted register
    reads from propagating into the scheduler capacity model
  - Add early-return in topology_update_cpu_capacity() when
    raw_capacity[cpu] is unchanged, avoiding redundant normalization
    and schedule_work() calls
  - Add zero capacity_scale guard in topology_update_cpu_capacity()
    to prevent division by zero in the normalization loop
  - Move guard(mutex) before the raw_capacity NULL check so that
    the pointer read is protected by the lock
  - Add CONFIG_GENERIC_ARCH_TOPOLOGY guard with no-op stub in
    arch_topology.h for configs where the topology subsystem is
    disabled

Xueqin Luo (3):
  cpufreq: cppc: Add update_limits support for Highest Performance
    changes
  cpufreq: cppc: Refactor autonomous perf bounds into helper
  arch_topology: Add topology_update_cpu_capacity() for runtime updates

 drivers/base/arch_topology.c   |  76 ++++++++++++++++
 drivers/cpufreq/cppc_cpufreq.c | 157 ++++++++++++++++++++++++++++++---
 include/linux/arch_topology.h  |  13 +++
 3 files changed, 233 insertions(+), 13 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-08-17 10:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07  6:08 [PATCH v5 0/3] cpufreq: cppc: Handle Highest Performance changes at runtime Xueqin Luo
2026-08-07  6:08 ` [PATCH v5 1/3] cpufreq: cppc: Add update_limits support for Highest Performance changes Xueqin Luo
2026-08-07  6:08 ` [PATCH v5 2/3] cpufreq: cppc: Refactor autonomous perf bounds into helper Xueqin Luo
2026-08-07  6:08 ` [PATCH v5 3/3] arch_topology: Add topology_update_cpu_capacity() for runtime updates Xueqin Luo
2026-08-10 14:33   ` Christian Loehle
2026-08-17 10:00     ` Xueqin Luo

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