diff options
| author | Guenter Roeck <linux@roeck-us.net> | 2026-11-09 18:13:26 -0800 |
|---|---|---|
| committer | Guenter Roeck <linux@roeck-us.net> | 2026-11-16 12:50:31 -0800 |
| commit | 3cc60eb1b9aa07da81593f8f027efefb67185144 (patch) | |
| tree | 3713d14213cde568f9f7119a04954e5c95c65312 /rust/kernel/alloc/allocator | |
| parent | 73d857b33cdfaf35f8d3f833b36745d91c18db13 (diff) | |
hwmon: (nct6775) Fix swapped temperature tolerance register writes
sensor_dev_template_pwm_temp_tolerance uses index 0 (backed by
REG_FAN_MODE via pwm_update_registers()) while
sensor_dev_template_pwm_crit_temp_tolerance uses index 1 (backed by
REG_CRITICAL_TEMP_TOLERANCE). However, store_temp_tolerance() checks
if (index) with inverted branches.
As a result, writing to pwm*_temp_tolerance writes the new tolerance to
REG_CRITICAL_TEMP_TOLERANCE instead of REG_FAN_MODE, while writing to
pwm*_crit_temp_tolerance updates REG_FAN_MODE with temp_tolerance[0] and
leaves REG_CRITICAL_TEMP_TOLERANCE unchanged.
Invert the index check in store_temp_tolerance() so index 0 updates fan
mode registers via pwm_update_registers() and index 1 writes to
REG_CRITICAL_TEMP_TOLERANCE.
Fixes: cdcaeceb74ff ("hwmon: (nct6775) Add support for automatic fan control")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Cc: Anton Lundin <glance@ac2.se>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'rust/kernel/alloc/allocator')
0 files changed, 0 insertions, 0 deletions
