mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: Guenter Roeck <linux@roeck-us.net>
Cc: david.nystrom@est.tech, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org,
	ricardo.neri@intel.com
Subject: Re: [PATCH 0/3] hwmon: (coretemp) Report unreliable temperature readings
Date: Fri, 25 Sep 2026 20:58:19 -0700	[thread overview]
Message-ID: <20260926035819.GA27616@ranerica-svr.sc.intel.com> (raw)
In-Reply-To: <254a2bdb-c759-469d-a1bb-c10f476cebe0@roeck-us.net>

On Fri, Sep 25, 2026 at 02:23:49PM -0700, Guenter Roeck wrote:
> On Fri, Sep 25, 2026 at 11:21:58AM -0700, Ricardo Neri wrote:
> > On Thu, Sep 24, 2026 at 07:37:18PM -0700, Guenter Roeck wrote:
> > > On Thu, Sep 24, 2026 at 07:33:19PM -0700, Ricardo Neri wrote:
> > > > Hi,
> > > > 
> > > > Intel CPUs indicate in IA32_[PACKAGE]_THERM_STATUS whether the digital
> > > > thermal readout they expose is valid. coretemp deliberately ignores that
> > > > indication, for the reason given in commit bf6ea084ebb5 ("hwmon:
> > > > (coretemp) Do not return -EAGAIN for low temperatures"): some CPUs clear
> > > > it while the temperature is too low to be measured, and the value reported
> > > > in that state is more useful to userspace than an error would be.
> > > > 
> > > > The consequence is that userspace cannot distinguish a genuinely low
> > > > temperature from one the CPU could not measure. This series exposes the
> > > > indication through the standard hwmon temp%d_fault attribute, leaving
> > > > temp%d_input exactly as it is.
> > > > 
> > > > One user-visible effect is worth mentioning: sensors(1) prints FAULT in
> > > > place of the temperature when temp%d_fault reads 1. On a CPU that clears
> > > > the valid bit at low temperature, that core stops showing a number in the
> > > > default output, although sensors -u and -j still report it, as does
> > > > anything that reads temp%d_input from sysfs directly. A driver-custom
> > > > attribute name would avoid this, but would be invisible to generic tools.
> > > > Reporting the condition through the documented attribute looks like a
> > > > better option, but please say if you prefer otherwise.
> > > 
> > > I think it would be _much_ better to return -ENODATA for invalid readings.
> > > This isn't really a fault, after all. The sensor is not defective,
> > > it just can not provide valid data.
> > > 
> > > With -ENODATA the sensors command reports N/A for the temperature
> > > measurement, which I also think would be better than reporting FAULT.
> > 
> > Thank you for your feedback and for applying the other two patches!
> > 
> > Thank you for your feedback anf for applying the first two patches!
> > 
> > Userspace has seen a number in temp%d_input for over 12 years, and with
> > this change it would get an error on CPUs that clear the valid bit. I can
> > certainly implement returning -ENODATA; I just want to confirm you don't
> > see this as an issue for userspace.
> > 
> 
> Userspace should be able to handle error returns. That is not an ABI change.
> Even if the fault attribute was implemented, trying to read the temperature
> should still return an error.

Then it seems that the fault attribute is redundant.

> 
> On the other side, claiming that the sensor is faulty is, in my opinion,
> just wrong. It is not faulty, it just does not return valid data.

I see. I will implement returning -ENODATA and drop the temp%d_fault.

Best,
Ricardo

      reply	other threads:[~2026-09-26  3:49 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-25  2:33 Ricardo Neri
2026-09-25  2:33 ` [PATCH 1/3] hwmon: (coretemp) Refresh the temperature on the first read Ricardo Neri
2026-09-25 14:03   ` Guenter Roeck
2026-09-25  2:33 ` [PATCH 2/3] hwmon: (coretemp) Read TjMax only when refreshing the temperature Ricardo Neri
2026-09-25 14:04   ` Guenter Roeck
2026-09-25  2:33 ` [PATCH 3/3] hwmon: (coretemp) Add temp%d_fault sysfs attribute Ricardo Neri
2026-09-25  2:37 ` [PATCH 0/3] hwmon: (coretemp) Report unreliable temperature readings Guenter Roeck
2026-09-25 18:21   ` Ricardo Neri
2026-09-25 21:23     ` Guenter Roeck
2026-09-26  3:58       ` Ricardo Neri [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=20260926035819.GA27616@ranerica-svr.sc.intel.com \
    --to=ricardo.neri-calderon@linux.intel.com \
    --cc=david.nystrom@est.tech \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=ricardo.neri@intel.com \
    /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

all inboxes | Powered by JetHome®