From: Sumit Gupta <sumitg@nvidia.com>
To: <rafael@kernel.org>, <viresh.kumar@linaro.org>,
<pierre.gondois@arm.com>, <ionela.voinescu@arm.com>,
<zhenglifeng1@huawei.com>, <zhanjie9@hisilicon.com>,
<saket.dumbre@intel.com>, <lenb@kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
<linux-acpi@vger.kernel.org>, <acpica-devel@lists.linux.dev>,
<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 v2 0/3] cpufreq: CPPC: Preserve OSPM-set registers across hotplug and unload
Date: Thu, 16 Jul 2026 21:08:17 +0530 [thread overview]
Message-ID: <20260716153820.2007095-1-sumitg@nvidia.com> (raw)
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
next reply other threads:[~2026-07-16 15:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 15:38 Sumit Gupta [this message]
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
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=20260716153820.2007095-1-sumitg@nvidia.com \
--to=sumitg@nvidia.com \
--cc=acpica-devel@lists.linux.dev \
--cc=bbasu@nvidia.com \
--cc=ionela.voinescu@arm.com \
--cc=jonathanh@nvidia.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=mochs@nvidia.com \
--cc=pierre.gondois@arm.com \
--cc=rafael@kernel.org \
--cc=saket.dumbre@intel.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