mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Samuel Wheeler via B4 Relay <devnull+swheel33.gmail.com@kernel.org>
To: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Shang En Sim <sim@shangen.org>,
	Samuel Wheeler <swheel33@gmail.com>
Subject: [PATCH 1/2] platform/x86: hp-wmi: Only use the low byte of the thermal profile
Date: Wed, 11 Nov 2026 21:54:26 -0500	[thread overview]
Message-ID: <20261111-omnibook-8eb4-v1-1-3127f45cc338@gmail.com> (raw)
In-Reply-To: <20261111-omnibook-8eb4-v1-0-3127f45cc338@gmail.com>

From: Samuel Wheeler <swheel33@gmail.com>

On the HP OmniBook Ultra Laptop 14-kd0xxx (board 8EB4, BIOS F.06), the
HPWMI_THERMAL_PROFILE_QUERY read returns the active profile in byte 0,
followed by status flags and a constant. With the "default" profile
active the four bytes are 01 11 04 00. thermal_profile_get() returns the
whole 32-bit value (0x041101), which matches none of the
HP_THERMAL_PROFILE_* values, so reading the platform profile always
fails with -EINVAL:

  platform_profile: Failed to get profile for handler hp-wmi

and /sys/firmware/acpi/platform_profile returns "Invalid argument".

The firmware's GTPS method (in the SSDT that defines \_SB.WMID) fills
byte 0 from the EC field GFCM (0-5), byte 1 with status flags (ONTB,
INBG, DPIN, PWDN, IBGE, MSFG) and byte 2 with 0x04. Setting a profile
already works: GFCM becomes 0, 1, 2 and 3 for performance, default, cool
and quiet.

Mask the value to its low byte. This also stops
thermal_profile_setup() from writing the status bytes back through
thermal_profile_set(tp) at probe time. That write was harmless on this
firmware, whose STPS method only reads byte 0, but it was not intended.
On firmware that already returns a zero-extended value the mask changes
nothing.

Tested on the OmniBook Ultra 14-kd0xxx: platform_profile reads
"balanced" instead of failing, and each profile reads back after being
set.

This patch was prepared with an AI coding assistant (Claude, by
Anthropic). It decompiled the ACPI tables, traced the WMI query, wrote
the change and this description, and ran the tests on my laptop under
my direction. I reviewed the change and the test results.

Signed-off-by: Samuel Wheeler <swheel33@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 0069af86800e..46c9a5a532ba 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -2117,7 +2117,16 @@ static int platform_profile_omen_set(struct device *dev,
 
 static int thermal_profile_get(void)
 {
-	return hp_wmi_read_int(HPWMI_THERMAL_PROFILE_QUERY);
+	int tp = hp_wmi_read_int(HPWMI_THERMAL_PROFILE_QUERY);
+
+	if (tp < 0)
+		return tp;
+
+	/*
+	 * The profile is in the low byte. Some firmware (e.g. board 8EB4)
+	 * returns status flags and a constant in the upper bytes.
+	 */
+	return tp & 0xff;
 }
 
 static int thermal_profile_set(int thermal_profile)

-- 
2.56.0



  reply	other threads:[~2026-11-12  2:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-12  2:54 [PATCH 0/2] platform/x86: hp-wmi: HP OmniBook Ultra 14-kd0xxx (8EB4) fixes Samuel Wheeler via B4 Relay
2026-11-12  2:54 ` Samuel Wheeler via B4 Relay [this message]
2026-11-12  2:54 ` [PATCH 2/2] platform/x86: hp-wmi: Add charge_behaviour quirk for OmniBook Ultra 14 Samuel Wheeler via B4 Relay

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=20261111-omnibook-8eb4-v1-1-3127f45cc338@gmail.com \
    --to=devnull+swheel33.gmail.com@kernel.org \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sim@shangen.org \
    --cc=swheel33@gmail.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

all inboxes | Powered by JetHome®