aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon/coretemp.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hwmon/coretemp.c')
-rw-r--r--drivers/hwmon/coretemp.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 2e5e2dc47eaf..78be66176840 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -316,6 +316,18 @@ static int adjust_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
316 return tjmax; 316 return tjmax;
317} 317}
318 318
319static bool cpu_has_tjmax(struct cpuinfo_x86 *c)
320{
321 u8 model = c->x86_model;
322
323 return model > 0xe &&
324 model != 0x1c &&
325 model != 0x26 &&
326 model != 0x27 &&
327 model != 0x35 &&
328 model != 0x36;
329}
330
319static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev) 331static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
320{ 332{
321 int err; 333 int err;
@@ -328,7 +340,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
328 */ 340 */
329 err = rdmsr_safe_on_cpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx); 341 err = rdmsr_safe_on_cpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
330 if (err) { 342 if (err) {
331 if (c->x86_model > 0xe && c->x86_model != 0x1c) 343 if (cpu_has_tjmax(c))
332 dev_warn(dev, "Unable to read TjMax from CPU %u\n", id); 344 dev_warn(dev, "Unable to read TjMax from CPU %u\n", id);
333 } else { 345 } else {
334 val = (eax >> 16) & 0xff; 346 val = (eax >> 16) & 0xff;