[PATCH v2 1/2] platform/x86: hp-wmi: Allow boards to skip the power limit refresh

From: David William Richmond Davies-Jones

Date: Sun Nov 22 2026 - 18:44:31 EST


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@xxxxxxxxxxxxxxx
Signed-off-by: David William Richmond Davies-Jones <david@xxxxxxxxxxxxxxxxxxxx>
---
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