]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
efi_selftest: restore gd before do_reset()
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Thu, 10 Sep 2020 05:47:58 +0000 (07:47 +0200)
committerHeinrich Schuchardt <xypron.glpk@gmx.de>
Mon, 14 Sep 2020 21:28:52 +0000 (23:28 +0200)
Before calling do_reset() in the EFI selftest we must restore the global
data pointer.

Fixes: fa63753f86cc ("efi_selftest: substitute ResetSystem() by do_reset()")
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
lib/efi_selftest/efi_selftest.c

index 6eec8ae2a7ce1c98c2143db631012b9ea8784a50..165fa265f236ee9b39d767d5921ac8900753be0f 100644 (file)
@@ -311,11 +311,13 @@ efi_status_t EFIAPI efi_selftest(efi_handle_t image_handle,
        efi_st_printf("Preparing for reset. Press any key...\n");
        efi_st_get_key();
 
-       if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET))
+       if (IS_ENABLED(CONFIG_EFI_HAVE_RUNTIME_RESET)) {
                runtime->reset_system(EFI_RESET_WARM, EFI_NOT_READY,
                                      sizeof(reset_message), reset_message);
-       else
+       } else {
+               efi_restore_gd();
                do_reset(NULL, 0, 0, NULL);
+       }
 
        efi_st_printf("\n");
        efi_st_error("Reset failed\n");