summaryrefslogtreecommitdiff
path: root/drivers/hwmon/coretemp.c
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2013-05-27 14:12:15 -0700
committerGuenter Roeck <linux@roeck-us.net>2013-08-11 22:10:38 -0700
commit1c2faa22472fedf2c420041033700c700a1dfc96 (patch)
treebb1105b835ada2b5c19e212e78c738374330d839 /drivers/hwmon/coretemp.c
parentd4e4ab86bcba5a72779c43dc1459f71fea3d89c8 (diff)
hwmon: (coretemp) Atom CPUs don't support TjMax; no warning needed
Display warning "Unable to read TjMax from CPU x" only if the CPU is supposed to support it. This is not the case for the various Atom CPUs. Signed-off-by: Guenter Roeck <linux@roeck-us.net>
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)
return tjmax;
}
+static bool cpu_has_tjmax(struct cpuinfo_x86 *c)
+{
+ u8 model = c->x86_model;
+
+ return model > 0xe &&
+ model != 0x1c &&
+ model != 0x26 &&
+ model != 0x27 &&
+ model != 0x35 &&
+ model != 0x36;
+}
+
static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
{
int err;
@@ -328,7 +340,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
*/
err = rdmsr_safe_on_cpu(id, MSR_IA32_TEMPERATURE_TARGET, &eax, &edx);
if (err) {
- if (c->x86_model > 0xe && c->x86_model != 0x1c)
+ if (cpu_has_tjmax(c))
dev_warn(dev, "Unable to read TjMax from CPU %u\n", id);
} else {
val = (eax >> 16) & 0xff;