mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] platform/x86: hp-wmi: fix power limit failure for Victus 15-fb0xxx (8A3D)
@ 2026-10-25  7:34 Sourav Nayak
  0 siblings, 0 replies; only message in thread
From: Sourav Nayak @ 2026-10-25  7:34 UTC (permalink / raw)
  To: ilpo.jarvinen; +Cc: platform-driver-x86, linux-kernel, Sourav Nayak

Victus 15-fb0xxx (8A3D) does not support 0x29 query,
Casuing severe CPU power limit after disconnect/connect of charger.

- Fix this regression by restoring user selected profile,
- It matches behaviour written in omen_power_source_event.

Error output:
[ +14.861905] hp_wmi: query 0x29 returned error 0x29
[  +0.000036] hp_wmi: Failed to actualize power limits: 41

Tested-by: Sourav Nayak <nonameblank007@gmail.com>
Signed-off-by: Sourav Nayak <nonameblank007@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index ee6de96b3280..9770cab99b9c 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -2355,6 +2355,25 @@ static int victus_s_powersource_event(struct notifier_block *nb,
 		return NOTIFY_DONE;
 	}
 
+	/*
+	 * For board 8A3D (victus_s_ec), query 0x29 is unsupported and makes
+	 * CPU power limit to 4-6W. Match omen_power_source_event omen/victus behavior:
+	 * if returning to AC and the profile differs from EC, restore the user-selected profile.
+	 */
+	if (hp_wmi_thermal_profile() == &victus_s_ec_thermal_params) {
+		if (power_supply_is_system_supplied() > 0 ||
+	    active_platform_profile != actual_profile)
+			return NOTIFY_DONE;
+
+		err = platform_profile_victus_s_set_ec(active_platform_profile);
+		if (err < 0) {
+			pr_warn("Failed to restore platform profile (%d)\n", err);
+			return  NOTIFY_DONE;
+		}
+
+		return NOTIFY_OK;
+	}
+
 	/*
 	 * Switching to battery power source while Performance mode is active
 	 * needs manual triggering of CPU power limits. Same goes when switching

base-commit: 5b0764a53235d3c77e1ed674e836e1b3fe1a4b1f
prerequisite-patch-id: 81b94f3910be80ec60f3b82188d4b141ac6c34d7
-- 
2.55.0


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-25  7:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-25  7:34 [PATCH] platform/x86: hp-wmi: fix power limit failure for Victus 15-fb0xxx (8A3D) Sourav Nayak

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®