]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
hwmon: (lm90) Add lock protection to lm90_alert
authorGuenter Roeck <linux@roeck-us.net>
Thu, 14 May 2026 21:41:00 +0000 (14:41 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sat, 16 May 2026 15:10:33 +0000 (08:10 -0700)
commit873e919e3101063a7a75989510ccfc125a4391cf
tree9d8b479869595016bdd607103e305cb5098b7027
parentb09a45601094c7f4ec4db8090b825fa61e169d93
hwmon: (lm90) Add lock protection to lm90_alert

Sashiko reports:

lm90_alert() executes in the smbus alert context and calls
lm90_update_confreg() to disable the hardware alert line, without
acquiring hwmon_lock.

Concurrently, sysfs write operations (such as lm90_write_convrate) hold
the hwmon_lock, temporarily modify data->config, and then restore it.

If an alert interrupt occurs concurrently with a sysfs write, the sysfs
path will overwrite the alert handler's modifications to data->config
and the hardware register.

This unintentionally re-enables the hardware alert line while the alarm is
still active, causing an interrupt storm.

Add the missing lock to lm90_alert() to solve the problem.

Fixes: 7a1d220ccb0cc ("hwmon: (lm90) Introduce function to update configuration register")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/lm90.c