Commit 873e919
committed
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: 7a1d220 ("hwmon: (lm90) Introduce function to update configuration register")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>1 parent b09a456 commit 873e919
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2946 | 2946 | | |
2947 | 2947 | | |
2948 | 2948 | | |
| 2949 | + | |
2949 | 2950 | | |
2950 | 2951 | | |
2951 | 2952 | | |
| |||
2955 | 2956 | | |
2956 | 2957 | | |
2957 | 2958 | | |
| 2959 | + | |
2958 | 2960 | | |
2959 | 2961 | | |
2960 | 2962 | | |
| |||
0 commit comments