Skip to content

Commit

Permalink
Merge tag 'microcode-fix-for-3.4' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/kernel/git/bp/bp into x86/urgent

Pull from Borislav Petkov a two-patch fix from Andreas taking care of a sysfs
warning when the microcode driver is loaded on unsupported platforms.

Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Ingo Molnar committed Apr 14, 2012
2 parents 668ce0a + 283c1f2 commit 1c2b443
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
12 changes: 7 additions & 5 deletions arch/x86/kernel/microcode_amd.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ static int collect_cpu_info_amd(int cpu, struct cpu_signature *csig)
{
struct cpuinfo_x86 *c = &cpu_data(cpu);

if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
pr_warning("CPU%d: family %d not supported\n", cpu, c->x86);
return -1;
}

csig->rev = c->microcode;
pr_info("CPU%d: patch_level=0x%08x\n", cpu, csig->rev);

Expand Down Expand Up @@ -380,6 +375,13 @@ static struct microcode_ops microcode_amd_ops = {

struct microcode_ops * __init init_amd_microcode(void)
{
struct cpuinfo_x86 *c = &cpu_data(0);

if (c->x86_vendor != X86_VENDOR_AMD || c->x86 < 0x10) {
pr_warning("AMD CPU family 0x%x not supported\n", c->x86);
return NULL;
}

patch = (void *)get_zeroed_page(GFP_KERNEL);
if (!patch)
return NULL;
Expand Down
10 changes: 4 additions & 6 deletions arch/x86/kernel/microcode_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,10 +419,8 @@ static int mc_device_add(struct device *dev, struct subsys_interface *sif)
if (err)
return err;

if (microcode_init_cpu(cpu) == UCODE_ERROR) {
sysfs_remove_group(&dev->kobj, &mc_attr_group);
if (microcode_init_cpu(cpu) == UCODE_ERROR)
return -EINVAL;
}

return err;
}
Expand Down Expand Up @@ -528,11 +526,11 @@ static int __init microcode_init(void)
microcode_ops = init_intel_microcode();
else if (c->x86_vendor == X86_VENDOR_AMD)
microcode_ops = init_amd_microcode();

if (!microcode_ops) {
else
pr_err("no support for this CPU vendor\n");

if (!microcode_ops)
return -ENODEV;
}

microcode_pdev = platform_device_register_simple("microcode", -1,
NULL, 0);
Expand Down

0 comments on commit 1c2b443

Please sign in to comment.