Re: [PATCH 1/3] hwmon: (coretemp) Refresh the temperature on the first read

From: Guenter Roeck

Date: Fri Sep 25 2026 - 10:09:01 EST


On Thu, Sep 24, 2026 at 07:33:20PM -0700, Ricardo Neri wrote:
> show_temp() reads the status MSR only when the cached temperature is
> older than one second. Commit 5c0e64dde80f ("hwmon: (coretemp) Remove
> obsolete temp_data->valid") dropped the tdata->valid check that used to
> force the very first read, leaving that comparison as the only trigger.
>
> A never-updated temp_data carries a zero timestamp, which does not look
> stale on 32-bit kernels: jiffies starts 300 seconds short of wrapping,
> so the comparison stays false until jiffies wraps and passes HZ. For the
> first 301 seconds of uptime temp%d_input reports the zero left by the
> allocator rather than the CPU temperature. 64-bit kernels are
> unaffected: jiffies starts at a positive value there and does not wrap.
>
> Backdate the timestamp when the temperature data is allocated. One jiffy
> older than the caching interval is stale under either word size, and the
> first refresh overwrites it.
>
> Fixes: 5c0e64dde80f ("hwmon: (coretemp) Remove obsolete temp_data->valid")
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>

Applied.

Thanks,
Guenter