aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:14:48 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-10-28 08:14:48 -0400
commit8237eb946a1a23c600fb289cf8dd3b399b10604e (patch)
treee3985782029601ede4035cfec7ee59e1a54324fd /drivers/hwmon
parentcc21fe518a971bb2b0ab8370ec46ea21e84c57ab (diff)
parentbcb80e53877c2045d9e52f4a71372c3fe6501f6f (diff)
Merge branch 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
* 'x86-microcode-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: x86, microcode, AMD: Add microcode revision to /proc/cpuinfo x86, microcode: Correct microcode revision format coretemp: Get microcode revision from cpu_data x86, intel: Use c->microcode for Atom errata check x86, intel: Output microcode revision in /proc/cpuinfo x86, microcode: Don't request microcode from userspace unnecessarily Fix up trivial conflicts in arch/x86/kernel/cpu/amd.c (conflict between moving AMD BSP code to cpu_dev helper function and adding AMD microcode revision to /proc/cpuinfo code)
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}