diff options
| -rw-r--r-- | arch/x86/kernel/cpu/microcode/core.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c index fa32cb3dcca5..5dd157d48606 100644 --- a/arch/x86/kernel/cpu/microcode/core.c +++ b/arch/x86/kernel/cpu/microcode/core.c | |||
| @@ -499,15 +499,10 @@ static int check_online_cpus(void) | |||
| 499 | static enum ucode_state reload_for_cpu(int cpu) | 499 | static enum ucode_state reload_for_cpu(int cpu) |
| 500 | { | 500 | { |
| 501 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; | 501 | struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
| 502 | enum ucode_state ustate; | ||
| 503 | 502 | ||
| 504 | if (!uci->valid) | 503 | if (!uci->valid) |
| 505 | return UCODE_OK; | 504 | return UCODE_OK; |
| 506 | 505 | ||
| 507 | ustate = microcode_ops->request_microcode_fw(cpu, µcode_pdev->dev, true); | ||
| 508 | if (ustate != UCODE_OK) | ||
| 509 | return ustate; | ||
| 510 | |||
| 511 | return apply_microcode_on_target(cpu); | 506 | return apply_microcode_on_target(cpu); |
| 512 | } | 507 | } |
| 513 | 508 | ||
| @@ -515,11 +510,11 @@ static ssize_t reload_store(struct device *dev, | |||
| 515 | struct device_attribute *attr, | 510 | struct device_attribute *attr, |
| 516 | const char *buf, size_t size) | 511 | const char *buf, size_t size) |
| 517 | { | 512 | { |
| 513 | int cpu, bsp = boot_cpu_data.cpu_index; | ||
| 518 | enum ucode_state tmp_ret = UCODE_OK; | 514 | enum ucode_state tmp_ret = UCODE_OK; |
| 519 | bool do_callback = false; | 515 | bool do_callback = false; |
| 520 | unsigned long val; | 516 | unsigned long val; |
| 521 | ssize_t ret = 0; | 517 | ssize_t ret = 0; |
| 522 | int cpu; | ||
| 523 | 518 | ||
| 524 | ret = kstrtoul(buf, 0, &val); | 519 | ret = kstrtoul(buf, 0, &val); |
| 525 | if (ret) | 520 | if (ret) |
| @@ -528,6 +523,10 @@ static ssize_t reload_store(struct device *dev, | |||
| 528 | if (val != 1) | 523 | if (val != 1) |
| 529 | return size; | 524 | return size; |
| 530 | 525 | ||
| 526 | tmp_ret = microcode_ops->request_microcode_fw(bsp, µcode_pdev->dev, true); | ||
| 527 | if (tmp_ret != UCODE_OK) | ||
| 528 | return size; | ||
| 529 | |||
| 531 | get_online_cpus(); | 530 | get_online_cpus(); |
| 532 | 531 | ||
| 533 | ret = check_online_cpus(); | 532 | ret = check_online_cpus(); |
