[PATCH v2 0/3] hwmon: (lm87) Handle I2C read and write errors

From: Baek Kyu, Kim

Date: Thu Oct 29 2026 - 12:40:41 EST


The LM87 driver does not check I2C transfer results in its sysfs stores,
sensor cache refresh, and device setup. As a result, failed writes can
be reported as successful and failed reads can be used as sensor data.

This series propagates transfer errors to sysfs and probe callers.
Cached settings change only after successful writes; a failed cache
refresh is retried, with alarms already read retained for the retry.

Under ARM64 QEMU/KVM, 46 emulated SMBus scenarios passed for LM87 and
ADM1024. The earlier aout_output regression suite passed all 118 checks.

Baek Kyu, Kim (3):
hwmon: (lm87) Propagate sysfs write errors
hwmon: (lm87) Propagate cached sensor read errors
hwmon: (lm87) Check I2C errors during detection and setup

drivers/hwmon/lm87.c | 384 ++++++++++++++++++++++++++++++++-----------
1 file changed, 284 insertions(+), 100 deletions(-)

---
Changes in v2:
- Address the other unchecked I2C writes and reads noted in the v1
review, beyond the original aout_output store.
- Group the changes into sysfs writes, cache refresh, and device
setup instead of fixing one call site per patch.
- Preserve alarms if a cache refresh fails after an alarm read.

Link to v1: https://lore.kernel.org/linux-hwmon/20261025150800.49041-1-pocj8ur4in@xxxxxxxxx/

--
2.55.0