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: use mod_delayed_work to reset keep-alive timer

Currently, schedule_delayed_work() is used to queue the 90s keep-alive
timer. If a user manually changes the fan speed at T=85s,
schedule_delayed_work() leaves the existing timer in place as it is a
no-op if the work is already pending. This results in the keep-alive
timer firing unnecessarily at T=90s, just 5 seconds after the user
action.

Replace schedule_delayed_work() with mod_delayed_work() to reset the
90s timer whenever fan settings are applied. This guarantees a full 90s
delay after every user interaction, preventing redundant keep-alive
executions and improving efficiency.

Fixes: c203c59fb5de ("platform/x86: hp-wmi: implement fan keep-alive")
Signed-off-by: Emre Cecanpunar <emreleno@gmail.com>
Link: https://patch.msgid.link/20260407142515.20683-4-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
6297443b 249ddba9

+4 -4
+4 -4
drivers/platform/x86/hp/hp-wmi.c
··· 2361 2361 ret = hp_wmi_fan_speed_max_set(1); 2362 2362 if (ret < 0) 2363 2363 return ret; 2364 - schedule_delayed_work(&priv->keep_alive_dwork, 2365 - secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); 2364 + mod_delayed_work(system_wq, &priv->keep_alive_dwork, 2365 + secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); 2366 2366 return 0; 2367 2367 case PWM_MODE_MANUAL: 2368 2368 if (!is_victus_s_thermal_profile()) ··· 2370 2370 ret = hp_wmi_fan_speed_set(priv, pwm_to_rpm(priv->pwm, priv)); 2371 2371 if (ret < 0) 2372 2372 return ret; 2373 - schedule_delayed_work(&priv->keep_alive_dwork, 2374 - secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); 2373 + mod_delayed_work(system_wq, &priv->keep_alive_dwork, 2374 + secs_to_jiffies(KEEP_ALIVE_DELAY_SECS)); 2375 2375 return 0; 2376 2376 case PWM_MODE_AUTO: 2377 2377 if (is_victus_s_thermal_profile()) {