Skip to content

hwmon: (nct6775) Fix target temperature and tolerance handling

Guenter Roeck linux-hwmon sashiko-reviews 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3hwmon: (nct6775) Fix target temp and tolerance for NCT6106/6116/6126drivers/hwmon/nct6775-core.c+9 -01 reply
2/3hwmon: (nct6775) Fix swapped temperature tolerance register writesdrivers/hwmon/nct6775-core.c+1 -10 replies
3/3hwmon: (nct6775) Fix tolerance bitmask when reading REG_FAN_MODEdrivers/hwmon/nct6775-core.c+2 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [RFT PATCH 0/3] hwmon: (nct6775) Fix target temperature and tolerance handling

From: Guenter Roeck <[email protected]>

This series fixes three bugs in fan target temperature and tolerance handling in the nct6775 driver:

- Patch 1 initializes target_temp_mask, tolerance_mask, and speed_tolerance_limit for NCT6106, NCT6116, and NCT6126 in nct6775_probe() so pwm*_target_temp and the tolerance attributes do not read or clamp to 0 and REG_FAN_MODE tolerance bits are cleared on updates.
- Patch 2 fixes the inverted index check in store_temp_tolerance() so writes to pwm*_temp_tolerance update REG_FAN_MODE and writes to pwm*_crit_temp_tolerance update REG_CRITICAL_TEMP_TOLERANCE instead of each writing the other's register.
- Patch 3 masks fanmodecfg with data->tolerance_mask instead of a hardcoded 0x0f in nct6775_update_pwm() so bit 3 of REG_FAN_MODE does not leak into cached tolerance values on chips with a 3-bit tolerance field.

Disclosure per Documentation/process/generated-content.rst:
Patch 1 was reported by Sashiko
(https://sashiko.dev/#/bug/linux-76f191d0-4c79-4982-887e-e5c9a2ed7136),
and patches 2 and 3 were flagged as pre-existing concerns by local sashiko review while reviewing patch 1. An AI coding assistant (Gemini) was prompted to investigate and fix the Sashiko report, fix the two additional issues reported by Sashiko, and write this cover letter; it generated the code changes, commit messages, and cover letter text. The series was build-tested on x86_64 with W=1, verified under User-Mode Linux (ARCH=um) using an out-of-tree simulated regmap test module exercising the affected sysfs attributes and register values (not tested on physical hardware), and checked with scripts/checkpatch.pl and sashiko review.

I don't have hardware to test the patches, therefore I am submitting them as RFT.

Guenter Roeck (3):
hwmon: (nct6775) Fix target temp and tolerance for NCT6106/6116/6126
hwmon: (nct6775) Fix swapped temperature tolerance register writes
hwmon: (nct6775) Fix tolerance bitmask when reading REG_FAN_MODE

 drivers/hwmon/nct6775-core.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)
Signature · 1 line
2.56.0