Skip to contentSkip to conversation

platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

PATCH Superseded Marco Scardovi 4 participants 9 messages Jun 19 – Jul 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

Hi everyone,

I was looking for [1] and come with a quick fix for it. Please review it and let me know if you have any questions/suggestions.

TL;DR: The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS.

This patch fixes a platform_profile regression on generic (non-Omen/non-Victus) HP laptops, where switching or querying power profiles fails with the error:
"platform_profile: Failed to get profile for handler hp-wmi"

We resolve this by:
1. Dynamically probing supported thermal profiles at boot time.
2. Initializing and updating a cached active_platform_profile.
3. Falling back to the cached profile if the BIOS query fails or returns an unmapped value.

This has been verified to build cleanly and resolves the reported Bugzilla issues 221569 and 220008.

[1] https://lore.kernel.org/platform-driver-x86/[email protected]/

Marco Scardovi (1):
platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

 drivers/platform/x86/hp/hp-wmi.c | 53 +++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 5 deletions(-)
Signature · 1 line
2.54.0
#1 lore raw

PATCH 1/1 platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

On generic (non-Omen/non-Victus) HP laptops supported by the hp-wmi driver, the platform_profile sysfs operations could fail, leading to 'platform_profile: Failed to get profile for handler hp-wmi' errors and preventing userspace power profile management from working correctly.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. Furthermore, when userspace switched profiles, hp_wmi_platform_profile_get() was called, which queried the BIOS using thermal_profile_get(). If the BIOS query returned an error or returned a value not in the recognized cases, the get call failed, throwing an error.

Fix this by:
1. Dynamically probing which thermal profiles are supported by the BIOS during driver registration by temporarily setting each profile and checking the return code, then restoring the original profile.
2. Initializing and updating active_platform_profile to cache the last set/boot profile.
3. Falling back to the cached active_platform_profile in hp_wmi_platform_profile_get() if the BIOS query fails or returns an invalid/unmapped value, rather than returning an error.

Fixes 4296f679ca50 ("platform/x86: hp-wmi: add platform profile support")
Assisted-by Antigravity:gemini-3.5-flash
---
 drivers/platform/x86/hp/hp-wmi.c | 53 +++++++++++++++++++++++++++++---
 1 file changed, 48 insertions(+), 5 deletions(-)
drivers/platform/x86/hp/hp-wmi.c +48 -5
index 8ba286ed8721..93df269445eb 100644
@@ -1662,8 +1662,11 @@ static int hp_wmi_platform_profile_get(struct device *dev,
 	int tp;
 
 	tp = thermal_profile_get();
-	if (tp < 0)
-		return tp;
+	if (tp < 0) {
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		return 0;
+	}
 
 	switch (tp) {
 	case HP_THERMAL_PROFILE_PERFORMANCE:
@@ -1679,7 +1682,9 @@ static int hp_wmi_platform_profile_get(struct device *dev,
 		*profile = PLATFORM_PROFILE_QUIET;
 		break;
 	default:
-		return -EINVAL;
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		break;
 	}
 
 	return 0;
@@ -1707,10 +1712,14 @@ static int hp_wmi_platform_profile_set(struct device *dev,
 		return -EOPNOTSUPP;
 	}
 
+	guard(mutex)(&active_platform_profile_lock);
+
 	err = thermal_profile_set(tp);
 	if (err)
 		return err;
 
+	active_platform_profile = profile;
+
 	return 0;
 }
 
@@ -2017,8 +2026,23 @@ static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices)
 		/* Adding an equivalent to HP Omen software ECO mode: */
 		set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
 	} else {
-		set_bit(PLATFORM_PROFILE_QUIET, choices);
-		set_bit(PLATFORM_PROFILE_COOL, choices);
+		int current_tp = thermal_profile_get();
+
+		if (current_tp < 0)
+			return current_tp;
+
+		if (thermal_profile_set(HP_THERMAL_PROFILE_QUIET) == 0)
+			set_bit(PLATFORM_PROFILE_QUIET, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_COOL) == 0)
+			set_bit(PLATFORM_PROFILE_COOL, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_DEFAULT) == 0)
+			set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_PERFORMANCE) == 0)
+			set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+
+		/* Restore the original thermal profile */
+		thermal_profile_set(current_tp);
+		return 0;
 	}
 
 	set_bit(PLATFORM_PROFILE_BALANCED, choices);
@@ -2263,6 +2287,25 @@ static int thermal_profile_setup(struct platform_device *device)
 		if (err)
 			return err;
 
+		/* Initialize active_platform_profile */
+		switch (tp) {
+		case HP_THERMAL_PROFILE_PERFORMANCE:
+			active_platform_profile = PLATFORM_PROFILE_PERFORMANCE;
+			break;
+		case HP_THERMAL_PROFILE_DEFAULT:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		case HP_THERMAL_PROFILE_COOL:
+			active_platform_profile = PLATFORM_PROFILE_COOL;
+			break;
+		case HP_THERMAL_PROFILE_QUIET:
+			active_platform_profile = PLATFORM_PROFILE_QUIET;
+			break;
+		default:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		}
+
 		ops = &hp_wmi_platform_profile_ops;
 	}
 
Signature · 1 line
2.54.0
#2 lore raw

Hello, thank you for work! This patch resolves kernel errors (platform_profile: Failed to get profile for handler hp-wmi) in the dmesg log on my system (HP OmniBook X Flip) during power profile switching.

Best regards,

Milan Oravec

CIKT UKF Nitra
Mobil/Signal: +421907670270
email: [email protected]

--------------------------------------------------------------------

Tuto spravu nepreveril ziadny antivirus - nebolo treba...

Quoted 130 lines · Marco Scardovi

On generic (non-Omen/non-Victus) HP laptops supported by the hp-wmi driver, the platform_profile sysfs operations could fail, leading to 'platform_profile: Failed to get profile for handler hp-wmi' errors and preventing userspace power profile management from working correctly.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. Furthermore, when userspace switched profiles, hp_wmi_platform_profile_get() was called, which queried the BIOS using thermal_profile_get(). If the BIOS query returned an error or returned a value not in the recognized cases, the get call failed, throwing an error.

Fix this by:
1. Dynamically probing which thermal profiles are supported by the BIOS during driver registration by temporarily setting each profile and checking the return code, then restoring the original profile.
2. Initializing and updating active_platform_profile to cache the last set/boot profile.
3. Falling back to the cached active_platform_profile in hp_wmi_platform_profile_get() if the BIOS query fails or returns an invalid/unmapped value, rather than returning an error.

Fixes 4296f679ca50 ("platform/x86: hp-wmi: add platform profile support")
Assisted-by Antigravity:gemini-3.5-flash
---
  drivers/platform/x86/hp/hp-wmi.c | 53 +++++++++++++++++++++++++++++---
  1 file changed, 48 insertions(+), 5 deletions(-)
drivers/platform/x86/hp/hp-wmi.c +48 -5
index 8ba286ed8721..93df269445eb 100644
@@ -1662,8 +1662,11 @@ static int hp_wmi_platform_profile_get(struct device *dev,
  	int tp;
 
  	tp = thermal_profile_get();
-	if (tp < 0)
-		return tp;
+	if (tp < 0) {
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		return 0;
+	}
 
  	switch (tp) {
  	case HP_THERMAL_PROFILE_PERFORMANCE:
@@ -1679,7 +1682,9 @@ static int hp_wmi_platform_profile_get(struct device *dev,
  		*profile = PLATFORM_PROFILE_QUIET;
  		break;
  	default:
-		return -EINVAL;
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		break;
  	}
 
  	return 0;
@@ -1707,10 +1712,14 @@ static int hp_wmi_platform_profile_set(struct device *dev,
  		return -EOPNOTSUPP;
  	}
 
+	guard(mutex)(&active_platform_profile_lock);
+
  	err = thermal_profile_set(tp);
  	if (err)
  		return err;
 
+	active_platform_profile = profile;
+
  	return 0;
  }
 
@@ -2017,8 +2026,23 @@ static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices)
  		/* Adding an equivalent to HP Omen software ECO mode: */
  		set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
  	} else {
-		set_bit(PLATFORM_PROFILE_QUIET, choices);
-		set_bit(PLATFORM_PROFILE_COOL, choices);
+		int current_tp = thermal_profile_get();
+
+		if (current_tp < 0)
+			return current_tp;
+
+		if (thermal_profile_set(HP_THERMAL_PROFILE_QUIET) == 0)
+			set_bit(PLATFORM_PROFILE_QUIET, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_COOL) == 0)
+			set_bit(PLATFORM_PROFILE_COOL, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_DEFAULT) == 0)
+			set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_PERFORMANCE) == 0)
+			set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+
+		/* Restore the original thermal profile */
+		thermal_profile_set(current_tp);
+		return 0;
  	}
 
  	set_bit(PLATFORM_PROFILE_BALANCED, choices);
@@ -2263,6 +2287,25 @@ static int thermal_profile_setup(struct platform_device *device)
  		if (err)
  			return err;
 
+		/* Initialize active_platform_profile */
+		switch (tp) {
+		case HP_THERMAL_PROFILE_PERFORMANCE:
+			active_platform_profile = PLATFORM_PROFILE_PERFORMANCE;
+			break;
+		case HP_THERMAL_PROFILE_DEFAULT:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		case HP_THERMAL_PROFILE_COOL:
+			active_platform_profile = PLATFORM_PROFILE_COOL;
+			break;
+		case HP_THERMAL_PROFILE_QUIET:
+			active_platform_profile = PLATFORM_PROFILE_QUIET;
+			break;
+		default:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		}
+
  		ops = &hp_wmi_platform_profile_ops;
  	}
 
#3 lore raw
In reply to Marco Scardovi
Quoted 24 lines · Marco Scardovi

On generic (non-Omen/non-Victus) HP laptops supported by the hp-wmi driver, the platform_profile sysfs operations could fail, leading to 'platform_profile: Failed to get profile for handler hp-wmi' errors and preventing userspace power profile management from working correctly.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. Furthermore, when userspace switched profiles, hp_wmi_platform_profile_get() was called, which queried the BIOS using thermal_profile_get(). If the BIOS query returned an error or returned a value not in the recognized cases, the get call failed, throwing an error.

Fix this by:
1. Dynamically probing which thermal profiles are supported by the BIOS during driver registration by temporarily setting each profile and checking the return code, then restoring the original profile.
2. Initializing and updating active_platform_profile to cache the last set/boot profile.
3. Falling back to the cached active_platform_profile in hp_wmi_platform_profile_get() if the BIOS query fails or returns an invalid/unmapped value, rather than returning an error.

Quoted 1 line

Is the patch tested by them?

Quoted 14 lines
Fixes 4296f679ca50 ("platform/x86: hp-wmi: add platform profile support")
Assisted-by Antigravity:gemini-3.5-flash

---
drivers/platform/x86/hp/hp-wmi.c | 53 +++++++++++++++++++++++++++++---

1 file changed, 48 insertions(+), 5 deletions(-)
drivers/platform/x86/hp/hp-wmi.c +0 -0
index 8ba286ed8721..93df269445eb 100644

drivers/platform/x86/hp/hp-wmi.c static int hp_wmi_platform_profile_get(struct device *dev, · line 1669

Quoted 10 lines
drivers/platform/x86/hp/hp-wmi.c +5 -2
@@ -1662,8 +1662,11 @@ static int hp_wmi_platform_profile_get(struct device *dev,
 	int tp;
 
 	tp = thermal_profile_get();
-	if (tp < 0)
-		return tp;
+	if (tp < 0) {
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		return 0;
+	}

This does silence the error but I don't think that's a wise decision since it effectively makes userspace blind to any WMI failure. Ideally, if thermal_profile_get() fails then the board isn't supposed to be using HPWMI_THERMAL_PROFILE_QUERY.

Quoted 38 lines
drivers/platform/x86/hp/hp-wmi.c +10 -3
 	switch (tp) {
 	case HP_THERMAL_PROFILE_PERFORMANCE:
@@ -1679,7 +1682,9 @@ static int hp_wmi_platform_profile_get(struct device *dev,
 		*profile = PLATFORM_PROFILE_QUIET;
 		break;
 	default:
-		return -EINVAL;
+		guard(mutex)(&active_platform_profile_lock);
+		*profile = active_platform_profile;
+		break;
 	}
 
 	return 0;
@@ -1707,10 +1712,14 @@ static int hp_wmi_platform_profile_set(struct device *dev,
 		return -EOPNOTSUPP;
 	}
 
+	guard(mutex)(&active_platform_profile_lock);
+
 	err = thermal_profile_set(tp);
 	if (err)
 		return err;
 
+	active_platform_profile = profile;
+
 	return 0;
 }
 
@@ -2017,8 +2026,23 @@ static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices)
 		/* Adding an equivalent to HP Omen software ECO mode: */
 		set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
 	} else {
-		set_bit(PLATFORM_PROFILE_QUIET, choices);
-		set_bit(PLATFORM_PROFILE_COOL, choices);
+		int current_tp = thermal_profile_get();
+
+		if (current_tp < 0)

drivers/platform/x86/hp/hp-wmi.c static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices) · line 2041

Quoted 10 lines
drivers/platform/x86/hp/hp-wmi.c +10 -0
+			return current_tp;
+
+		if (thermal_profile_set(HP_THERMAL_PROFILE_QUIET) == 0)
+			set_bit(PLATFORM_PROFILE_QUIET, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_COOL) == 0)
+			set_bit(PLATFORM_PROFILE_COOL, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_DEFAULT) == 0)
+			set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		if (thermal_profile_set(HP_THERMAL_PROFILE_PERFORMANCE) == 0)
+			set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);

Probing for HP_THERMAL_PROFILE_DEFAULT and HP_THERMAL_PROFILE_PERFORMANCE seem redundant since those bits are unconditionally set in this function after the if-else blocks.

Quoted 36 lines
drivers/platform/x86/hp/hp-wmi.c +23 -0
+
+		/* Restore the original thermal profile */
+		thermal_profile_set(current_tp);
+		return 0;
 	}
 
 	set_bit(PLATFORM_PROFILE_BALANCED, choices);
@@ -2263,6 +2287,25 @@ static int thermal_profile_setup(struct platform_device *device)
 		if (err)
 			return err;
 
+		/* Initialize active_platform_profile */
+		switch (tp) {
+		case HP_THERMAL_PROFILE_PERFORMANCE:
+			active_platform_profile = PLATFORM_PROFILE_PERFORMANCE;
+			break;
+		case HP_THERMAL_PROFILE_DEFAULT:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		case HP_THERMAL_PROFILE_COOL:
+			active_platform_profile = PLATFORM_PROFILE_COOL;
+			break;
+		case HP_THERMAL_PROFILE_QUIET:
+			active_platform_profile = PLATFORM_PROFILE_QUIET;
+			break;
+		default:
+			active_platform_profile = PLATFORM_PROFILE_BALANCED;
+			break;
+		}
+
 		ops = &hp_wmi_platform_profile_ops;
 	}
 
Signature · 1 line
2.54.0
#4 lore raw

v2 cover platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

Hi Krishna,

Thank you for your review :) Your points were indeed correct so I came up with another way to fix it.

Here is v2 of the patch to fix platform_profile support on generic HP laptops. To answer your question the patch has been tested by Milan, who reported bug 221569. For 220008 I had not any response from TuralTo unfortunately but the underlying problem was the same AFAICS.

@milan please test this out and let me know like you did before.

Changes in v2:
- Drop active_platform_profile fallback/caching and mutex logic for generic HP laptops. Propagate WMI query errors directly to userspace instead of silencing them, as suggested.
- Restructure the probe function to explicitly set platform profile choices in each path rather than relying on a confusing combination of early returns and fall-throughs.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. This patch fixes a platform_profile regression on generic (non-Omen/non-Victus) HP laptops, where switching or querying power profiles fails with the error:
"platform_profile: Failed to get profile for handler hp-wmi"

We resolve this by dynamically probing supported thermal profiles at boot time by temporarily setting each profile and checking the return code, then restoring the original profile.

Marco Scardovi (1):
platform/x86: hp-wmi: fix platform profile issues on generic HP
laptops

 drivers/platform/x86/hp/hp-wmi.c | 37 ++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 7 deletions(-)
Signature · 1 line
2.54.0
#5 lore raw

PATCH v2 1/1 platform/x86: hp-wmi: fix platform profile issues on generic HP laptops

On generic (non-Omen/non-Victus) HP laptops supported by the hp-wmi driver, the platform_profile sysfs operations could fail, leading to 'platform_profile: Failed to get profile for handler hp-wmi' errors and preventing userspace power profile management from working correctly.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. Furthermore, when userspace switched profiles, hp_wmi_platform_profile_get() was called, which queried the BIOS using thermal_profile_get(). If the BIOS query returned an error or returned a value not in the recognized cases, the get call failed, throwing an error.

Fix this by dynamically probing which thermal profiles are supported by the BIOS during driver registration. This is done by temporarily setting each profile and checking the return code, then restoring the original profile. Restructure the probe function to explicitly populate choices for each laptop type, avoiding confusing fall-through behavior.

There are no expected negative side effects, as the active profile is restored to its original state during probe time, and only validated profiles are exposed.

Fixes 4296f679ca50 ("platform/x86: hp-wmi: add platform profile support")
Assisted-by Antigravity:gemini-3.5-flash
---
 drivers/platform/x86/hp/hp-wmi.c | 37 ++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 7 deletions(-)
drivers/platform/x86/hp/hp-wmi.c +30 -7
index 8ba286ed8721..82fdfaa169ec 100644
@@ -2011,19 +2011,42 @@ static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices)
 {
 	if (is_omen_thermal_profile()) {
 		set_bit(PLATFORM_PROFILE_COOL, choices);
-	} else if (is_victus_thermal_profile()) {
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
+	}
+
+	if (is_victus_thermal_profile()) {
 		set_bit(PLATFORM_PROFILE_QUIET, choices);
-	} else if (is_victus_s_thermal_profile()) {
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
+	}
+
+	if (is_victus_s_thermal_profile()) {
 		/* Adding an equivalent to HP Omen software ECO mode: */
 		set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
-	} else {
-		set_bit(PLATFORM_PROFILE_QUIET, choices);
-		set_bit(PLATFORM_PROFILE_COOL, choices);
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
 	}
 
-	set_bit(PLATFORM_PROFILE_BALANCED, choices);
-	set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+	/* Generic HP laptops supported by hp-wmi: probe dynamically */
+	int current_tp = thermal_profile_get();
+	if (current_tp < 0)
+		return current_tp;
+
+	if (thermal_profile_set(HP_THERMAL_PROFILE_QUIET) == 0)
+		set_bit(PLATFORM_PROFILE_QUIET, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_COOL) == 0)
+		set_bit(PLATFORM_PROFILE_COOL, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_DEFAULT) == 0)
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_PERFORMANCE) == 0)
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
 
+	/* Restore original thermal profile */
+	thermal_profile_set(current_tp);
 	return 0;
 }
 
Signature · 1 line
2.54.0
maintainer
#6 lore raw
Quoted 56 lines · Marco Scardovi

On generic (non-Omen/non-Victus) HP laptops supported by the hp-wmi driver, the platform_profile sysfs operations could fail, leading to 'platform_profile: Failed to get profile for handler hp-wmi' errors and preventing userspace power profile management from working correctly.

The driver was blindly registering all 4 profiles (quiet, cool, balanced, performance) without checking which ones were actually supported by the BIOS. Furthermore, when userspace switched profiles, hp_wmi_platform_profile_get() was called, which queried the BIOS using thermal_profile_get(). If the BIOS query returned an error or returned a value not in the recognized cases, the get call failed, throwing an error.

Fix this by dynamically probing which thermal profiles are supported by the BIOS during driver registration. This is done by temporarily setting each profile and checking the return code, then restoring the original profile. Restructure the probe function to explicitly populate choices for each laptop type, avoiding confusing fall-through behavior.

There are no expected negative side effects, as the active profile is restored to its original state during probe time, and only validated profiles are exposed.

Fixes 4296f679ca50 ("platform/x86: hp-wmi: add platform profile support")
Assisted-by Antigravity:gemini-3.5-flash
---
 drivers/platform/x86/hp/hp-wmi.c | 37 ++++++++++++++++++++++++++------
 1 file changed, 30 insertions(+), 7 deletions(-)
drivers/platform/x86/hp/hp-wmi.c +11 -2
index 8ba286ed8721..82fdfaa169ec 100644
@@ -2011,19 +2011,42 @@ static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices)
 {
 	if (is_omen_thermal_profile()) {
 		set_bit(PLATFORM_PROFILE_COOL, choices);
-	} else if (is_victus_thermal_profile()) {
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
+	}
+
+	if (is_victus_thermal_profile()) {
 		set_bit(PLATFORM_PROFILE_QUIET, choices);
-	} else if (is_victus_s_thermal_profile()) {
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
+	}
+

drivers/platform/x86/hp/hp-wmi.c static int hp_wmi_platform_profile_probe(void *drvdata, unsigned long *choices) · line 2032

Quoted 10 lines
drivers/platform/x86/hp/hp-wmi.c +4 -3
+	if (is_victus_s_thermal_profile()) {
 		/* Adding an equivalent to HP Omen software ECO mode: */
 		set_bit(PLATFORM_PROFILE_LOW_POWER, choices);
-	} else {
-		set_bit(PLATFORM_PROFILE_QUIET, choices);
-		set_bit(PLATFORM_PROFILE_COOL, choices);
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+		return 0;
 	}

You'll need to write a better justification into the changelog if you want to have these above included. It also looks largely unrelated to what you're doing according to changelog so it might actually belong to another patch but without proper explanation, I'm pretty much in dark why you're doing these in the first place.

Quoted 22 lines
drivers/platform/x86/hp/hp-wmi.c +15 -2
-	set_bit(PLATFORM_PROFILE_BALANCED, choices);
-	set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
+	/* Generic HP laptops supported by hp-wmi: probe dynamically */
+	int current_tp = thermal_profile_get();
+	if (current_tp < 0)
+		return current_tp;
+
+	if (thermal_profile_set(HP_THERMAL_PROFILE_QUIET) == 0)
+		set_bit(PLATFORM_PROFILE_QUIET, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_COOL) == 0)
+		set_bit(PLATFORM_PROFILE_COOL, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_DEFAULT) == 0)
+		set_bit(PLATFORM_PROFILE_BALANCED, choices);
+	if (thermal_profile_set(HP_THERMAL_PROFILE_PERFORMANCE) == 0)
+		set_bit(PLATFORM_PROFILE_PERFORMANCE, choices);
 
+	/* Restore original thermal profile */
+	thermal_profile_set(current_tp);
 	return 0;
 }
 
 
Signature · 1 line
 i.
#7 lore raw

In data martedì 7 luglio 2026 18:40:39 Ora legale dell’Europa centrale, Ilpo Järvinen ha scritto:

Quoted 9 lines · Marco Scardovi
Quoted 1 line

...

You'll need to write a better justification into the changelog if you want to have these above included. It also looks largely unrelated to what you're doing according to changelog so it might actually belong to another patch but without proper explanation, I'm pretty much in dark why you're doing these in the first place.

Hi Ilpo,

I totally forgot I had this thread open.
Please consider this patch as void: I can't assure anymore its validity in the long run and it's better if it's taken over by HP guys instead of me tbh, also because I don't have a valid device to test it myself in the first place.

With best regards,
Marco

maintainer
#8 lore raw
Quoted 10 lines · Marco Scardovi

In data martedì 7 luglio 2026 18:40:39 Ora legale dell’Europa centrale, Ilpo Järvinen ha scritto:

Quoted 9 lines · Marco Scardovi
Quoted 1 line

...

You'll need to write a better justification into the changelog if you want to have these above included. It also looks largely unrelated to what you're doing according to changelog so it might actually belong to another patch but without proper explanation, I'm pretty much in dark why you're doing these in the first place.

Quoted 7 lines

Hi Ilpo,

I totally forgot I had this thread open.
Please consider this patch as void: I can't assure anymore its validity in the long run and it's better if it's taken over by HP guys instead of me tbh, also because I don't have a valid device to test it myself in the first place.

Okay. It seems Krishna is already looking at the "platform_profile:
Failed to get profile for handler hp-wmi" part so we've hope of getting some solution from him eventually.

The other problems look unrelated to pdx86.

Signature · 1 line
 i.