Skip to content

Commit bb9973e

Browse files
author
Guenter Roeck
committed
hwmon: (coretemp) Further relax temperature range checks
Further relax temperature range checks after reading the IA32_TEMPERATURE_TARGET register. If the register returns a value other than 0 in bits 16..32, assume that the returned value is correct. This change applies to both packet and core temperature limits. Cc: Carsten Emde <C.Emde@osadl.org> Cc: Fenghua Yu <fenghua.yu@intel.com> Cc: Jean Delvare <khali@linux-fr.org> Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Acked-by: Fenghua Yu <fenghua.yu@intel.com>
1 parent 4f5f71a commit bb9973e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hwmon/coretemp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
296296
* If the TjMax is not plausible, an assumption
297297
* will be used
298298
*/
299-
if (val >= 70 && val <= 125) {
299+
if (val) {
300300
dev_info(dev, "TjMax is %d C.\n", val);
301301
return val * 1000;
302302
}
@@ -326,7 +326,7 @@ static int get_pkg_tjmax(unsigned int cpu, struct device *dev)
326326
err = rdmsr_safe_on_cpu(cpu, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
327327
if (!err) {
328328
val = (eax >> 16) & 0xff;
329-
if (val > 80 && val < 120)
329+
if (val)
330330
return val * 1000;
331331
}
332332
dev_warn(dev, "Unable to read Pkg-TjMax from CPU:%u\n", cpu);

0 commit comments

Comments
 (0)