mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] hwmon: (coretemp) Report unreliable temperature readings
@ 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
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Ricardo Neri @ 2026-09-25  2:33 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: david.nystrom, linux-hwmon, linux-kernel, linux-doc,
	ricardo.neri, Ricardo Neri

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.

Patch 1 is pre-work: it fixes an existing bug where, on 32-bit kernels,
the first temperature read is skipped and temp%d_input reports zero for
the first 301 seconds of uptime. Both the bug and the fix were verified
with a 32-bit kernel. It carries a Fixes: tag and does not depend on the
rest of the series.

Patch 2 stops reading TjMax on a cache hit, where the value is discarded.
It is separate so that the behavioral change is not buried in the
restructuring patch 3 does.

Patch 3 adds temp%d_fault.

Thanks and BR,
Ricardo

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
---
Ricardo Neri (3):
      hwmon: (coretemp) Refresh the temperature on the first read
      hwmon: (coretemp) Read TjMax only when refreshing the temperature
      hwmon: (coretemp) Add temp%d_fault sysfs attribute

 Documentation/hwmon/coretemp.rst |  4 +++
 drivers/hwmon/coretemp.c         | 71 +++++++++++++++++++++++++++++-----------
 2 files changed, 55 insertions(+), 20 deletions(-)
---
base-commit: 93f51579e7df248780214094418f205253383cc5
change-id: 20260831-coretemp-temp-fault-a44c447936ec

Best regards,
-- 
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-09-25  2:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-25  2:33 [PATCH 0/3] hwmon: (coretemp) Report unreliable temperature readings Ricardo Neri
2026-09-25  2:33 ` [PATCH 1/3] hwmon: (coretemp) Refresh the temperature on the first read Ricardo Neri
2026-09-25  2:33 ` [PATCH 2/3] hwmon: (coretemp) Read TjMax only when refreshing the temperature Ricardo Neri
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

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®