Linux Hardware Monitor development
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "蔡 德彝" <Spector.Tsai@outlook.com>
Cc: Zev Weiss <zev@bewilderbeest.net>,
	"linux-hwmon@vger.kernel.org" <linux-hwmon@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings
Date: Fri, 28 Aug 2026 08:50:28 -0700	[thread overview]
Message-ID: <cdcb9768-70f3-413c-baf4-02ca58e37337@roeck-us.net> (raw)
In-Reply-To: <20260824184443.81887-1-Spector.Tsai@outlook.com>

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);
>   	}
>   


      parent reply	other threads:[~2026-08-28 15:50 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-24 18:44 [RFC PATCH] hwmon: (nct6775) Ignore 0xffff TSI temperature readings 蔡 紱彝
2026-08-24 18:57 ` sashiko-bot
2026-08-28 15:50 ` Guenter Roeck [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=cdcb9768-70f3-413c-baf4-02ca58e37337@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=Spector.Tsai@outlook.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zev@bewilderbeest.net \
    /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