]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
x86/microcode/AMD: Do not return error when microcode update is not necessary
authorAnnie Li <jiayanli@google.com>
Wed, 30 Apr 2025 05:34:24 +0000 (05:34 +0000)
committerBorislav Petkov (AMD) <bp@alien8.de>
Wed, 30 Apr 2025 15:10:46 +0000 (17:10 +0200)
After

  6f059e634dcd("x86/microcode: Clarify the late load logic"),

if the load is up-to-date, the AMD side returns UCODE_OK which leads to
load_late_locked() returning -EBADFD.

Handle UCODE_OK in the switch case to avoid this error.

  [ bp: Massage commit message. ]

Fixes: 6f059e634dcd ("x86/microcode: Clarify the late load logic")
Signed-off-by: Annie Li <jiayanli@google.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Link: https://lore.kernel.org/20250430053424.77438-1-jiayanli@google.com
arch/x86/kernel/cpu/microcode/core.c

index b3658d11e7b69224a0e9e59be9d730ae7b9b5f06..2309321cf6a19221a0c4331b1ff99c11032d4a4a 100644 (file)
@@ -686,6 +686,8 @@ static int load_late_locked(void)
                return load_late_stop_cpus(true);
        case UCODE_NFOUND:
                return -ENOENT;
+       case UCODE_OK:
+               return 0;
        default:
                return -EBADFD;
        }