From: Sumit Gupta <sumitg@nvidia.com>
To: <rafael@kernel.org>, <viresh.kumar@linaro.org>,
<pierre.gondois@arm.com>, <christian.loehle@arm.com>,
<ionela.voinescu@arm.com>, <zhenglifeng1@huawei.com>,
<zhanjie9@hisilicon.com>, <lenb@kernel.org>, <ray.huang@amd.com>,
<mario.limonciello@amd.com>, <perry.yuan@amd.com>,
<kprateek.nayak@amd.com>, <maciej.wieczor-retman@intel.com>,
<pawel.chmielewski@intel.com>, <linux-pm@vger.kernel.org>,
<linux-acpi@vger.kernel.org>, <acpica-devel@lists.linux.dev>,
<linux-kernel@vger.kernel.org>, <linux-tegra@vger.kernel.org>
Cc: <treding@nvidia.com>, <jonathanh@nvidia.com>, <vsethi@nvidia.com>,
<ksitaraman@nvidia.com>, <sanjayc@nvidia.com>, <mochs@nvidia.com>,
<bbasu@nvidia.com>, <sumitg@nvidia.com>
Subject: [PATCH v9 0/8] ACPI / cpufreq: CPPC: Preserve OSPM-set registers and add ospm_nominal_perf
Date: Sat, 7 Nov 2026 01:02:56 +0530 [thread overview]
Message-ID: <20261106193304.3347374-1-sumitg@nvidia.com> (raw)
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
next reply other threads:[~2026-11-06 19:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-06 19:32 Sumit Gupta [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261106193304.3347374-1-sumitg@nvidia.com \
--to=sumitg@nvidia.com \
--cc=acpica-devel@lists.linux.dev \
--cc=bbasu@nvidia.com \
--cc=christian.loehle@arm.com \
--cc=ionela.voinescu@arm.com \
--cc=jonathanh@nvidia.com \
--cc=kprateek.nayak@amd.com \
--cc=ksitaraman@nvidia.com \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=maciej.wieczor-retman@intel.com \
--cc=mario.limonciello@amd.com \
--cc=mochs@nvidia.com \
--cc=pawel.chmielewski@intel.com \
--cc=perry.yuan@amd.com \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=ray.huang@amd.com \
--cc=sanjayc@nvidia.com \
--cc=treding@nvidia.com \
--cc=viresh.kumar@linaro.org \
--cc=vsethi@nvidia.com \
--cc=zhanjie9@hisilicon.com \
--cc=zhenglifeng1@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®