From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Guenter Roeck <linux@roeck-us.net>,
Sashiko <sashiko-bot@kernel.org>, Anton Lundin <glance@ac2.se>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.1.y 4/4] hwmon: (nct6775) Fix target temp and tolerance for NCT6106/6116/6126
Date: Thu, 3 Dec 2026 22:42:18 -0500 [thread overview]
Message-ID: <20261204034157.2461916-4-sashal@kernel.org> (raw)
In-Reply-To: <20261204034157.2461916-1-sashal@kernel.org>
From: Guenter Roeck <linux@roeck-us.net>
[ Upstream commit 73d857b33cdfaf35f8d3f833b36745d91c18db13 ]
In nct6775_probe(), the nct6106, nct6116, and nct6126 chip cases leave
target_temp_mask, tolerance_mask, and speed_tolerance_limit
zero-initialized.
As a result, reading pwm*_target_temp from sysfs always returns 0,
writing to pwm*_target_temp, pwm*_temp_tolerance,
pwm*_crit_temp_tolerance, or fan*_tolerance clamps user-supplied values
to 0, and pwm_update_registers() fails to clear existing tolerance bits
in REG_FAN_MODE when updating fan control modes.
Initialize target_temp_mask to 0xff, tolerance_mask to 0x07, and
speed_tolerance_limit to 63 for NCT6106, NCT6116, and NCT6126, matching
the hardware register layout shared with NCT5525 and NCT6776+.
Fixes: 6c009501ff20 ("hwmon: (nct6775) Add support for NCT6102D/6106D")
Fixes: 29c7cb485b32 ("hwmon: (nct6775) Integrate new model nct6116")
Fixes: 437b3c2a4bdc ("hwmon: (nct6775) Add support for NCT6126D")
Cc: stable@vger.kernel.org
Reported-by: Sashiko <sashiko-bot@kernel.org>
Link: https://sashiko.dev/#/bug/linux-76f191d0-4c79-4982-887e-e5c9a2ed7136
Cc: Anton Lundin <glance@ac2.se>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
[ sashal: Dropped the duplicate hunk that upstream applied to a second chip case, since that block doesn't exist in this tree, so the mask and tolerance assignments land only in the one remaining case. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/hwmon/nct6775-core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 5f335a2046ad2..3f7f6c8923e07 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -3531,6 +3531,9 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
data->fan_from_reg = fan_from_reg13;
data->fan_from_reg_min = fan_from_reg13;
+ data->target_temp_mask = 0xff;
+ data->tolerance_mask = 0x07;
+ data->speed_tolerance_limit = 63;
data->temp_label = nct6776_temp_label;
data->temp_mask = NCT6776_TEMP_MASK;
@@ -3607,6 +3610,9 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
data->fan_from_reg = fan_from_reg13;
data->fan_from_reg_min = fan_from_reg13;
+ data->target_temp_mask = 0xff;
+ data->tolerance_mask = 0x07;
+ data->speed_tolerance_limit = 63;
data->temp_label = nct6776_temp_label;
data->temp_mask = NCT6776_TEMP_MASK;
--
2.53.0
prev parent reply other threads:[~2026-12-04 3:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 13:09 FAILED: patch "[PATCH] hwmon: (nct6775) Fix target temp and tolerance for" failed to apply to 6.1-stable tree gregkh
2026-12-04 3:42 ` [PATCH 6.1.y 1/4] hwmon: (nct6775) Change labels for nct6799 Sasha Levin
2026-12-04 3:42 ` [PATCH 6.1.y 2/4] hwmon: (nct6775-platform) Explicitly initialize nct6775_sio_names indexes Sasha Levin
2026-12-04 3:42 ` [PATCH 6.1.y 3/4] hwmon: (nct6775-core) Explicitly initialize nct6775_device_names indexes Sasha Levin
2026-12-04 3:42 ` Sasha Levin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261204034157.2461916-4-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=glance@ac2.se \
--cc=linux@roeck-us.net \
--cc=sashiko-bot@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox