hwmon: (coretemp) Extend the bitmask to read temperature to 0xff
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Thu, 25 Apr 2024 17:13:11 +0000 (10:13 -0700)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 28 Apr 2024 17:08:43 +0000 (10:08 -0700)
commitf0c344c000d09e38a0240b4a6ccbcd553b18e762
treefa2cc95ca143f8fe09507787fa7f87f95385a4a1
parentf4a86616d142dd3ccff3785c0599c16571c6ef1b
hwmon: (coretemp) Extend the bitmask to read temperature to 0xff

The Intel Software Development manual defines the temperature digital
readout as the bits [22:16] of the IA32_[PACKAGE]_THERM_STATUS registers.
Bit 23 is specified as reserved.

In recent processors, however, the temperature digital readout uses bits
[23:16]. In those processors, using the bitmask 0x7f would lead to
incorrect readings if the temperature deviates from TjMax by more than
127 degrees Celsius.

Although not guaranteed, bit 23 is likely to be 0 in processors from a few
generations ago. The temperature reading would still be correct in those
processors when using a 0xff bitmask.

Model-specific provisions can be made for older processors in which bit 23
is not 0 should the need arise.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://lore.kernel.org/r/20240425171311.19519-4-ricardo.neri-calderon@linux.intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/coretemp.c