[PATCH v2 0/4] hwmon: chipcap2: various bug fixes

From: Javier Carrasco

Date: Sun Aug 23 2026 - 13:59:19 EST


The original issue (race condition for the alarms) was found by Sashiko[1]
when an unrelated patch affected chipcap2.c. The issue is real as the
access to the variables is not protected by any locking mechanism
although 2 different sources (threaded interrupts and sysfs) could
modify them.

After sending the fix, Sashiko found new issues[2] that have been added to
the series:
- Wrong channel number in hwmon_notify_event(): pass 0 as the channel
number.
- IRQ teardown ordering: split the current implementation to provide the
available interrupts before registering the hwmon device, and register
the IRQs after the hwmon device has been registered.
- Enable IRQ processing when the regulator is already enabled.

The fixes have been validated on real hardware with an Amphenol
ChipCap 2 CC2D23S sensor.

[1] Link: https://lore.kernel.org/linux-hwmon/20260625162114.417EA1F000E9@xxxxxxxxxxxxxxx/
[2] Link: https://lore.kernel.org/linux-hwmon/20260821093706.D1EB11F000E9@xxxxxxxxxxxxxxx/

To: Guenter Roeck <linux@xxxxxxxxxxxx>
Cc: linux-hwmon@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>

Changes in v2:
- Add fixes to the new issues reported by Sashiko.
- Use hwmon subsystem lock.
- Link to v1: https://lore.kernel.org/r/20260821-chipcap2_locks-v1-1-1d8ccabfc1b2@xxxxxxxxx

---
Javier Carrasco (4):
hwmon: chipcap2: fix channels in humidity alarm notifications
hwmon: chipcap2: fix IRQ teardown ordering
hwmon: chipcap2: enable IRQ processing when regulator is already enabled
hwmon: chipcap2: serialize access to low/high_alarm indicators

drivers/hwmon/chipcap2.c | 76 ++++++++++++++++++++++++------------------------
1 file changed, 38 insertions(+), 38 deletions(-)
---
base-commit: 388b607d107c07aaade04c7f22f344cab6bdccd3
change-id: 20260820-chipcap2_locks-c01013a24a0c

Best regards,
--
Javier Carrasco <javier.carrasco.cruz@xxxxxxxxx>