aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/microcode_core.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kernel/microcode_core.c')
-rw-r--r--arch/x86/kernel/microcode_core.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
index 2bcad3926edb..e68aae397869 100644
--- a/arch/x86/kernel/microcode_core.c
+++ b/arch/x86/kernel/microcode_core.c
@@ -391,7 +391,7 @@ static enum ucode_state microcode_update_cpu(int cpu)
391 struct ucode_cpu_info *uci = ucode_cpu_info + cpu; 391 struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
392 enum ucode_state ustate; 392 enum ucode_state ustate;
393 393
394 if (uci->valid) 394 if (uci->valid && uci->mc)
395 ustate = microcode_resume_cpu(cpu); 395 ustate = microcode_resume_cpu(cpu);
396 else 396 else
397 ustate = microcode_init_cpu(cpu); 397 ustate = microcode_init_cpu(cpu);
@@ -518,6 +518,9 @@ static int __init microcode_init(void)
518 return PTR_ERR(microcode_pdev); 518 return PTR_ERR(microcode_pdev);
519 } 519 }
520 520
521 if (microcode_ops->init)
522 microcode_ops->init(&microcode_pdev->dev);
523
521 get_online_cpus(); 524 get_online_cpus();
522 mutex_lock(&microcode_mutex); 525 mutex_lock(&microcode_mutex);
523 526
@@ -561,6 +564,9 @@ static void __exit microcode_exit(void)
561 564
562 platform_device_unregister(microcode_pdev); 565 platform_device_unregister(microcode_pdev);
563 566
567 if (microcode_ops->fini)
568 microcode_ops->fini();
569
564 microcode_ops = NULL; 570 microcode_ops = NULL;
565 571
566 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n"); 572 pr_info("Microcode Update Driver: v" MICROCODE_VERSION " removed.\n");