aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2011-10-12 20:46:35 -0400
committerIngo Molnar <mingo@elte.hu>2011-10-14 07:16:42 -0400
commitca8bc8dc044793ee4d59ff7fe40138eee27d0325 (patch)
tree01355030982b5923551e1cedc48326b728ae5487 /drivers/hwmon
parent30963c0ac721f70aea0352ed1cd0fc3cfbaef730 (diff)
coretemp: Get microcode revision from cpu_data
Now that the ucode revision is available in cpu_data remove the existing code in coretemp.c to query it manually. Read the ucode revision from cpu_data instead Signed-off-by: Andi Kleen <ak@linux.intel.com> Acked-by: H. Peter Anvin <hpa@zytor.com> Cc: jbeulich@novell.com Cc: fenghua.yu@intel.com Cc: khali@linux-fr.org Link: http://lkml.kernel.org/r/1318466795-7393-3-git-send-email-andi@firstfloor.org Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/coretemp.c28
1 files changed, 4 insertions, 24 deletions
diff --git a/drivers/hwmon/coretemp.c b/drivers/hwmon/coretemp.c
index 932383786642..ce18c046f728 100644
--- a/drivers/hwmon/coretemp.c
+++ b/drivers/hwmon/coretemp.c
@@ -325,15 +325,6 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
325 return adjust_tjmax(c, id, dev); 325 return adjust_tjmax(c, id, dev);
326} 326}
327 327
328static void __devinit get_ucode_rev_on_cpu(void *edx)
329{
330 u32 eax;
331
332 wrmsr(MSR_IA32_UCODE_REV, 0, 0);
333 sync_core();
334 rdmsr(MSR_IA32_UCODE_REV, eax, *(u32 *)edx);
335}
336
337static int create_name_attr(struct platform_data *pdata, struct device *dev) 328static int create_name_attr(struct platform_data *pdata, struct device *dev)
338{ 329{
339 sysfs_attr_init(&pdata->name_attr.attr); 330 sysfs_attr_init(&pdata->name_attr.attr);
@@ -380,27 +371,16 @@ exit_free:
380static int __cpuinit chk_ucode_version(unsigned int cpu) 371static int __cpuinit chk_ucode_version(unsigned int cpu)
381{ 372{
382 struct cpuinfo_x86 *c = &cpu_data(cpu); 373 struct cpuinfo_x86 *c = &cpu_data(cpu);
383 int err;
384 u32 edx;
385 374
386 /* 375 /*
387 * Check if we have problem with errata AE18 of Core processors: 376 * Check if we have problem with errata AE18 of Core processors:
388 * Readings might stop update when processor visited too deep sleep, 377 * Readings might stop update when processor visited too deep sleep,
389 * fixed for stepping D0 (6EC). 378 * fixed for stepping D0 (6EC).
390 */ 379 */
391 if (c->x86_model == 0xe && c->x86_mask < 0xc) { 380 if (c->x86_model == 0xe && c->x86_mask < 0xc && c->microcode < 0x39) {
392 /* check for microcode update */ 381 pr_err("Errata AE18 not fixed, update BIOS or "
393 err = smp_call_function_single(cpu, get_ucode_rev_on_cpu, 382 "microcode of the CPU!\n");
394 &edx, 1); 383 return -ENODEV;
395 if (err) {
396 pr_err("Cannot determine microcode revision of "
397 "CPU#%u (%d)!\n", cpu, err);
398 return -ENODEV;
399 } else if (edx < 0x39) {
400 pr_err("Errata AE18 not fixed, update BIOS or "
401 "microcode of the CPU!\n");
402 return -ENODEV;
403 }
404 } 384 }
405 return 0; 385 return 0;
406} 386}