From: David William Richmond Davies-Jones <david@exultantmonkey.co.uk>
To: "Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Krishna Chomal <krishna.chomal108@gmail.com>,
Julien ROBIN <julien.robin28@free.fr>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org,
David William Richmond Davies-Jones <david@exultantmonkey.co.uk>,
stable@vger.kernel.org
Subject: [PATCH v2 1/2] platform/x86: hp-wmi: Allow boards to skip the power limit refresh
Date: Sun, 22 Nov 2026 23:43:50 +0000 [thread overview]
Message-ID: <20261122234351.278694-2-david@exultantmonkey.co.uk> (raw)
In-Reply-To: <20261122234351.278694-1-david@exultantmonkey.co.uk>
When the power source changes while the performance profile is active,
victus_s_powersource_event() refreshes the CPU power limits by sending
SET_POWER_LIMITS with PL1 and PL2 set to HP_POWER_LIMIT_DEFAULT (0).
This was added for the Victus 16-s1034nf (board 8C9C), whose firmware
treats 0 as "restore the defaults".
Not all firmware does. On the OMEN 15-en1xxx (board 88D2, AMD Ryzen 7
5800H) the SET_POWER_LIMITS handler (GM29) multiplies both values by
1000 and passes them to ALIB function 0x0C as the SPPT and FPPT limits
whenever the EC power level (OCPC) is 0, the highest level:
Local2 *= 0x03E8
Local3 *= 0x03E8
If ((^^PCI0.SBRG.EC0.OCPC == Zero))
{
DPTC (0x05, Local2)
DPTC (0x07, Local3)
}
Under full load in the performance profile on battery this holds the
CPU at 399 MHz and below 5 W.
This firmware already sets these limits itself on power source changes.
The EC query handler that notifies the AC device (_Q20) also applies
them according to the adapter state and the EC power level: 25 W on
battery and up to 54 W on AC. On such boards the refresh is unnecessary
as well as harmful.
Add a no_power_limit_reset flag to struct hp_wmi_board_params so such
boards can skip the refresh. No board sets it yet.
The firmware analysis and this patch were prepared with the help of an
AI coding assistant (Claude Opus 5.5 in Claude Code). The result was
reviewed and tested on the hardware by the submitter.
Cc: stable@vger.kernel.org
Signed-off-by: David William Richmond Davies-Jones <david@exultantmonkey.co.uk>
---
drivers/platform/x86/hp/hp-wmi.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 0069af86800e..c7960de7ac0f 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -154,6 +154,12 @@ struct hp_wmi_fan_profile_params {
struct hp_wmi_board_params {
const struct thermal_profile_params *thermal_profile;
const struct hp_wmi_fan_profile_params *fan_profile;
+ /*
+ * Set when SET_POWER_LIMITS applies HP_POWER_LIMIT_DEFAULT as a literal
+ * 0 W CPU limit instead of restoring the defaults, so the power limits
+ * must not be refreshed on power source changes.
+ */
+ bool no_power_limit_reset;
};
static int hp_wmi_get_fan_speed_victus_s(int fan);
@@ -2621,7 +2627,8 @@ static int victus_s_powersource_event(struct notifier_block *nb,
* Seen on HP 16-s1034nf (board 8C9C) with F.11 and F.13 BIOS versions.
*/
- if (actual_profile == PLATFORM_PROFILE_PERFORMANCE) {
+ if (actual_profile == PLATFORM_PROFILE_PERFORMANCE &&
+ !active_board_params->no_power_limit_reset) {
pr_debug("Triggering CPU PL1/PL2 actualization\n");
err = victus_s_set_cpu_pl1_pl2(HP_POWER_LIMIT_DEFAULT,
HP_POWER_LIMIT_DEFAULT);
--
2.56.1
next prev parent reply other threads:[~2026-11-22 23:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-22 23:43 [PATCH v2 0/2] platform/x86: hp-wmi: Fix cTGP and power limits on OMEN 15-en1xxx (88D2) David William Richmond Davies-Jones
2026-11-22 23:43 ` David William Richmond Davies-Jones [this message]
2026-11-22 23:43 ` [PATCH v2 2/2] platform/x86: hp-wmi: Move OMEN 15-en1xxx (board 88D2) to feature board list David William Richmond Davies-Jones
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=20261122234351.278694-2-david@exultantmonkey.co.uk \
--to=david@exultantmonkey.co.uk \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=julien.robin28@free.fr \
--cc=krishna.chomal108@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=stable@vger.kernel.org \
/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®