* [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings
@ 2026-08-24 18:44 蔡 紱彝
2026-08-28 15:50 ` Guenter Roeck
0 siblings, 1 reply; 2+ messages in thread
From: 蔡 紱彝 @ 2026-08-24 18:44 UTC (permalink / raw)
To: Guenter Roeck; +Cc: Zev Weiss, linux-hwmon, linux-kernel
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.
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@outlook.com>
---
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);
}
--
2.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings
2026-08-24 18:44 [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings 蔡 紱彝
@ 2026-08-28 15:50 ` Guenter Roeck
0 siblings, 0 replies; 2+ messages in thread
From: Guenter Roeck @ 2026-08-28 15:50 UTC (permalink / raw)
To: 蔡 德彝; +Cc: Zev Weiss, linux-hwmon, linux-kernel
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@outlook.com>
> ---
> 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);
> }
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-08-28 15:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-24 18:44 [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings 蔡 紱彝
2026-08-28 15:50 ` Guenter Roeck
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®