* [PATCH 0/5] platform/x86: hp-wmi: fix bugs in Victus S fan control
@ 2026-03-20 23:54 Emre Cecanpunar
0 siblings, 0 replies; 3+ messages in thread
From: Emre Cecanpunar @ 2026-03-20 23:54 UTC (permalink / raw)
To: platform-driver-x86
Cc: hansg, ilpo.jarvinen, krishna.chomal108, linux-kernel, Emre Cecanpunar
This series fixes five bugs in the hwmon fan control code added for
HP Victus S laptops:
- Return values from WMI calls were silently discarded in two paths
of hp_wmi_apply_fan_settings(), and the function's own return value
was ignored by both of its callers.
- cancel_delayed_work_sync() was called from inside the work handler
it was trying to cancel, causing a potential deadlock.
- schedule_delayed_work() does not reset a pending timer, so rapid
back-to-back fan updates did not extend the keep-alive window.
- u8 arithmetic was used to compute a signed delta, producing silent
unsigned wrap-around on malformed firmware fan tables.
- mode and pwm fields in hp_wmi_hwmon_priv were accessed from both
sysfs and workqueue context without any synchronisation.
Patches are ordered so that each one applies cleanly on top of the
previous. Patches 1-4 are independent fixes; patch 5 (locking) builds
on patch 2 (cancel_delayed_work) to avoid a lock-ordering issue.
Emre Cecanpunar (5):
platform/x86: hp-wmi: fix ignored return values in fan settings
platform/x86: hp-wmi: avoid cancel_delayed_work_sync from work handler
platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer
platform/x86: hp-wmi: fix u8 underflow in gpu_delta calculation
platform/x86: hp-wmi: add locking for concurrent hwmon access
drivers/platform/x86/hp/hp-wmi.c | 59 ++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 18 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 0/5] platform/x86: hp-wmi: fix bugs in Victus S fan control
2026-03-20 23:55 Emre Cecanpunar
@ 2026-03-22 16:27 ` Krishna Chomal
0 siblings, 0 replies; 3+ messages in thread
From: Krishna Chomal @ 2026-03-22 16:27 UTC (permalink / raw)
To: Emre Cecanpunar; +Cc: hansg, ilpo.jarvinen, linux-kernel, platform-driver-x86
On Sat, Mar 21, 2026 at 02:55:52AM +0300, Emre Cecanpunar wrote:
>This series fixes five bugs in the hwmon fan control code added for
>HP Victus S laptops:
>
>- Return values from WMI calls were silently discarded in two paths
> of hp_wmi_apply_fan_settings(), and the function's own return value
> was ignored by both of its callers.
>- cancel_delayed_work_sync() was called from inside the work handler
> it was trying to cancel, causing a potential deadlock.
>- schedule_delayed_work() does not reset a pending timer, so rapid
> back-to-back fan updates did not extend the keep-alive window.
>- u8 arithmetic was used to compute a signed delta, producing silent
> unsigned wrap-around on malformed firmware fan tables.
>- mode and pwm fields in hp_wmi_hwmon_priv were accessed from both
> sysfs and workqueue context without any synchronisation.
>
>Patches are ordered so that each one applies cleanly on top of the
>previous. Patches 1-4 are independent fixes; patch 5 (locking) builds
>on patch 2 (cancel_delayed_work) to avoid a lock-ordering issue.
>
>Emre Cecanpunar (5):
> platform/x86: hp-wmi: fix ignored return values in fan settings
> platform/x86: hp-wmi: avoid cancel_delayed_work_sync from work handler
> platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer
> platform/x86: hp-wmi: fix u8 underflow in gpu_delta calculation
> platform/x86: hp-wmi: add locking for concurrent hwmon access
>
> drivers/platform/x86/hp/hp-wmi.c | 59 ++++++++++++++++++++++----------
> 1 file changed, 41 insertions(+), 18 deletions(-)
>
>--
>2.53.0
>
Hi Emre,
Thank you for reviewing and catching these bugs. As this was my first
attempt with delayed workqueues, I appreciate the bug fixes, specially
regarding the deadlock.
I have tested this series on my hardware (board ID: 8C78) and can
confirm that the fans still behave correctly with the improvements.
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 0/5] platform/x86: hp-wmi: fix bugs in Victus S fan control
@ 2026-03-20 23:55 Emre Cecanpunar
2026-03-22 16:27 ` Krishna Chomal
0 siblings, 1 reply; 3+ messages in thread
From: Emre Cecanpunar @ 2026-03-20 23:55 UTC (permalink / raw)
To: platform-driver-x86
Cc: hansg, ilpo.jarvinen, krishna.chomal108, linux-kernel, Emre Cecanpunar
This series fixes five bugs in the hwmon fan control code added for
HP Victus S laptops:
- Return values from WMI calls were silently discarded in two paths
of hp_wmi_apply_fan_settings(), and the function's own return value
was ignored by both of its callers.
- cancel_delayed_work_sync() was called from inside the work handler
it was trying to cancel, causing a potential deadlock.
- schedule_delayed_work() does not reset a pending timer, so rapid
back-to-back fan updates did not extend the keep-alive window.
- u8 arithmetic was used to compute a signed delta, producing silent
unsigned wrap-around on malformed firmware fan tables.
- mode and pwm fields in hp_wmi_hwmon_priv were accessed from both
sysfs and workqueue context without any synchronisation.
Patches are ordered so that each one applies cleanly on top of the
previous. Patches 1-4 are independent fixes; patch 5 (locking) builds
on patch 2 (cancel_delayed_work) to avoid a lock-ordering issue.
Emre Cecanpunar (5):
platform/x86: hp-wmi: fix ignored return values in fan settings
platform/x86: hp-wmi: avoid cancel_delayed_work_sync from work handler
platform/x86: hp-wmi: use mod_delayed_work to reset keep-alive timer
platform/x86: hp-wmi: fix u8 underflow in gpu_delta calculation
platform/x86: hp-wmi: add locking for concurrent hwmon access
drivers/platform/x86/hp/hp-wmi.c | 59 ++++++++++++++++++++++----------
1 file changed, 41 insertions(+), 18 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-22 16:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-20 23:54 [PATCH 0/5] platform/x86: hp-wmi: fix bugs in Victus S fan control Emre Cecanpunar
2026-03-20 23:55 Emre Cecanpunar
2026-03-22 16:27 ` Krishna Chomal
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®