summaryrefslogtreecommitdiff
path: root/tools/lib/python
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2026-10-04 22:15:39 +0000
committerGuenter Roeck <linux@roeck-us.net>2026-10-20 15:41:30 -0700
commitb8249a3b6b36937e660d7217773ab18111c6b7fe (patch)
treee4aee6765df265d30c789eafd79355928c090280 /tools/lib/python
parent2281f0473fa257d19d59c9e430e91b5a76f418bc (diff)
downloadlinux-b8249a3b6b36937e660d7217773ab18111c6b7fe.tar.gz
linux-b8249a3b6b36937e660d7217773ab18111c6b7fe.zip
hwmon: (nct7904) serialise the watchdog and sensors
The registers of the chip are banked: each access selects the bank, which is cached in data->bank_sel, and then reads or writes the register. bank_lock used to make the two steps atomic. It has been removed because the hwmon core serialises the sensor callbacks, but the watchdog callbacks use the same access functions and are not called by the hwmon core. So a sensor can now be read while the watchdog is being pinged. If one of them selects its bank between the two steps of the other, the second step hits a register of the wrong bank: the watchdog is not fed, or its commands are written to some sensor or fan control register. Take the lock of the hwmon device in the watchdog callbacks. The watchdog is registered after the hwmon device, and devres unregisters it first. Fixes: 9ad270bf4dcc ("hwmon: (nct7904) Rely on subsystem locking") Assisted-by: LLM Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions