Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

platform/x86: hp-wmi: fix u8 underflow in gpu_delta calculation

gpu_delta was declared as u8. If the firmware specifies a GPU RPM
lower than the CPU RPM, subtracting them causes an underflow
(e.g. 10 - 20 = 246), which forces the GPU fan to remain clamped at
U8_MAX (100% speed) during operation.

Change gpu_delta to int and use signed arithmetic. Existing signed logic
in hp_wmi_fan_speed_set() correctly handles negative deltas.

Fixes: 46be1453e6e6 ("platform/x86: hp-wmi: add manual fan control for Victus S models")
Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
Link: https://patch.msgid.link/20260407142515.20683-5-emreleno@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

authored by

Emre Cecanpunar and committed by
Ilpo Järvinen
cb4daa45 6297443b

+3 -3
+3 -3
drivers/platform/x86/hp/hp-wmi.c
··· 455 455 struct hp_wmi_hwmon_priv { 456 456 u8 min_rpm; 457 457 u8 max_rpm; 458 - u8 gpu_delta; 458 + int gpu_delta; 459 459 u8 mode; 460 460 u8 pwm; 461 461 struct delayed_work keep_alive_dwork; ··· 2549 2549 { 2550 2550 u8 fan_data[128] = { 0 }; 2551 2551 struct victus_s_fan_table *fan_table; 2552 - u8 min_rpm, max_rpm, gpu_delta; 2553 - int ret; 2552 + u8 min_rpm, max_rpm; 2553 + int gpu_delta, ret; 2554 2554 2555 2555 /* Default behaviour on hwmon init is automatic mode */ 2556 2556 priv->mode = PWM_MODE_AUTO;