Re: [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings
From: Guenter Roeck
Date: Fri Aug 28 2026 - 11:52:13 EST
On 8/24/26 11:44, 蔡 德彝 wrote:
On an NCT6793D, unused TSI temperature channels can return 0xffff.
The driver currently treats every non-zero TSI register value as an
active channel. This causes unused TSI channels to be exposed through
hwmon and results in bogus temperature readings of 3892313987
millidegrees Celsius.
Treat 0xffff as an inactive TSI channel.
With this change, the unused TSI channels are no longer exposed, while
TSI0 continues to report normally.
As pointed out by Sashiko, the fix is incomplete. The tsi_temp array should
be declared as u16. Also, at runtime, show_tsi_temp() should check if
data->tsi_temp[sattr->index] == 0xffff and return -ENODATA if that is the case.
Thanks,
Guenter
Tested on an ASRock A320M-HDV R4.0 with an NCT6793D.
Fixes: b68437ace4b8 ("hwmon: (nct6775) add support for TSI temperature registers")
Assisted-by: ChatGPT:GPT-5.6-Sol
Signed-off-by: Spector Tsai <Spector.Tsai@xxxxxxxxxxx>
---
drivers/hwmon/nct6775-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/nct6775-core.c b/drivers/hwmon/nct6775-core.c
index 759ea3d1286e..34e6a01aa4e4 100644
--- a/drivers/hwmon/nct6775-core.c
+++ b/drivers/hwmon/nct6775-core.c
@@ -4339,7 +4339,7 @@ int nct6775_probe(struct device *dev, struct nct6775_data *data,
err = nct6775_read_value(data, data->REG_TSI_TEMP[i], &tmp);
if (err)
return err;
- if (tmp)
+ if (tmp && tmp != 0xffff)
data->have_tsi_temp |= BIT(i);
}