Re: [PATCH 5/5] platform/x86: hp-wmi: report fan speed command failures
From: Ilpo Järvinen
Date: Tue Jul 21 2026 - 12:24:20 EST
On Thu, 16 Jul 2026, Emre Cecanpunar wrote:
> hp_wmi_fan_speed_set() passes the raw WMI result to
> hp_wmi_apply_fan_settings(), which only checks for negative errors. A
> positive HP firmware error consequently reaches the success path and
> schedules keep-alive work for a fan speed that was not applied.
Missing info on which hw this problem occurs.
> Convert positive firmware errors to -EINVAL before returning from the fan
> speed helper, matching the other fan control commands.
>
> Fixes: c203c59fb5de ("platform/x86: hp-wmi: implement fan keep-alive")
> Signed-off-by: Emre Cecanpunar <emreleno@xxxxxxxxx>
> ---
> drivers/platform/x86/hp/hp-wmi.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/hp/hp-wmi.c b/drivers/platform/x86/hp/hp-wmi.c
> index 65c3bac17ad6..8f8da31bd5ef 100644
> --- a/drivers/platform/x86/hp/hp-wmi.c
> +++ b/drivers/platform/x86/hp/hp-wmi.c
> @@ -907,8 +907,10 @@ static int hp_wmi_fan_speed_set(struct hp_wmi_hwmon_priv *priv)
> return ret;
> ret = hp_wmi_perform_query(HPWMI_VICTUS_S_FAN_SPEED_SET_QUERY, HPWMI_GM,
> &fan_speed, sizeof(fan_speed), 0);
> + if (ret)
> + return ret < 0 ? ret : -EINVAL;
>
> - return ret;
> + return 0;
You know the drill by now.
--
i.