mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sourav Nayak <nonameblank007@gmail.com>
To: ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Sourav Nayak <nonameblank007@gmail.com>
Subject: [PATCH] platform/x86: hp-wmi: fix power limit failure for Victus 15-fb0xxx (8A3D)
Date: Sun, 25 Oct 2026 13:04:06 +0530	[thread overview]
Message-ID: <20261025073406.10085-1-nonameblank007@gmail.com> (raw)

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


                 reply	other threads:[~2026-10-25  7:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20261025073406.10085-1-nonameblank007@gmail.com \
    --to=nonameblank007@gmail.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@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®