Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ca8bc8dc authored by Andi Kleen's avatar Andi Kleen Committed by Ingo Molnar
Browse files

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: default avatarAndi Kleen <ak@linux.intel.com>
Acked-by: default avatarH. 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: default avatarIngo Molnar <mingo@elte.hu>
parent 30963c0a
Loading
Loading
Loading
Loading
+4 −24
Original line number Original line Diff line number Diff line
@@ -325,15 +325,6 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
	return adjust_tjmax(c, id, dev);
	return adjust_tjmax(c, id, dev);
}
}


static void __devinit get_ucode_rev_on_cpu(void *edx)
{
	u32 eax;

	wrmsr(MSR_IA32_UCODE_REV, 0, 0);
	sync_core();
	rdmsr(MSR_IA32_UCODE_REV, eax, *(u32 *)edx);
}

static int create_name_attr(struct platform_data *pdata, struct device *dev)
static int create_name_attr(struct platform_data *pdata, struct device *dev)
{
{
	sysfs_attr_init(&pdata->name_attr.attr);
	sysfs_attr_init(&pdata->name_attr.attr);
@@ -380,28 +371,17 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
static int __cpuinit chk_ucode_version(unsigned int cpu)
static int __cpuinit chk_ucode_version(unsigned int cpu)
{
{
	struct cpuinfo_x86 *c = &cpu_data(cpu);
	struct cpuinfo_x86 *c = &cpu_data(cpu);
	int err;
	u32 edx;


	/*
	/*
	 * Check if we have problem with errata AE18 of Core processors:
	 * Check if we have problem with errata AE18 of Core processors:
	 * Readings might stop update when processor visited too deep sleep,
	 * Readings might stop update when processor visited too deep sleep,
	 * fixed for stepping D0 (6EC).
	 * fixed for stepping D0 (6EC).
	 */
	 */
	if (c->x86_model == 0xe && c->x86_mask < 0xc) {
	if (c->x86_model == 0xe && c->x86_mask < 0xc && c->microcode < 0x39) {
		/* check for microcode update */
		err = smp_call_function_single(cpu, get_ucode_rev_on_cpu,
					       &edx, 1);
		if (err) {
			pr_err("Cannot determine microcode revision of "
			       "CPU#%u (%d)!\n", cpu, err);
			return -ENODEV;
		} else if (edx < 0x39) {
		pr_err("Errata AE18 not fixed, update BIOS or "
		pr_err("Errata AE18 not fixed, update BIOS or "
		       "microcode of the CPU!\n");
		       "microcode of the CPU!\n");
		return -ENODEV;
		return -ENODEV;
	}
	}
	}
	return 0;
	return 0;
}
}