mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yousef Alhouseen <alhouseenyousef@gmail.com>
To: "Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: Krishna Chomal <krishna.chomal108@gmail.com>,
	"Rafael J . Wysocki" <rafael.j.wysocki@intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Yousef Alhouseen <alhouseenyousef@gmail.com>
Subject: [PATCH] platform/x86: hp-wmi: handle positive BIOS error codes
Date: Tue, 30 Jun 2026 12:52:34 +0200	[thread overview]
Message-ID: <20260630105234.54638-1-alhouseenyousef@gmail.com> (raw)

hp_wmi_perform_query() returns firmware BIOS error codes as positive
values.  The Victus-S profile callers only reject negative errors, then
consume output fields that are not filled for a positive firmware error.

Treat every nonzero result from victus_s_gpu_thermal_profile_get()
as a failed query before using its outputs.

Signed-off-by: Yousef Alhouseen <alhouseenyousef@gmail.com>
---
 drivers/platform/x86/hp/hp-wmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
index 8ba286ed8721..50c5a1e152dd 100644
--- a/drivers/platform/x86/hp/hp-wmi.c
+++ b/drivers/platform/x86/hp/hp-wmi.c
@@ -1825,7 +1825,7 @@ static int victus_s_gpu_thermal_profile_set(bool ctgp_enable,
 					       &current_ppab_state,
 					       &current_dstate,
 					       &current_gpu_slowdown_temp);
-	if (ret < 0) {
+	if (ret) {
 		pr_warn("GPU modes not updated, unable to get slowdown temp\n");
 		return ret;
 	}
@@ -1907,7 +1907,7 @@ static int platform_profile_victus_s_get_ec(enum platform_profile_option *profil
 						       &current_ppab_state,
 						       &current_dstate,
 						       &current_gpu_slowdown_temp);
-		if (ret < 0)
+		if (ret)
 			return ret;
 		if (current_ctgp_state == 0 && current_ppab_state == 0)
 			*profile = PLATFORM_PROFILE_LOW_POWER;
-- 
2.54.0


             reply	other threads:[~2026-06-30 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-30 10:52 Yousef Alhouseen [this message]
2026-07-21 17:28 ` Ilpo Järvinen
2026-07-30 22:08   ` Yousef Alhouseen

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=20260630105234.54638-1-alhouseenyousef@gmail.com \
    --to=alhouseenyousef@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=krishna.chomal108@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.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®