diff --git a/drivers/firmware/efi/libstub/efi-stub-helper.c b/drivers/firmware/efi/libstub/efi-stub-helper.c index 35713b3fca96..265f88beaaaf 100644 --- a/drivers/firmware/efi/libstub/efi-stub-helper.c +++ b/drivers/firmware/efi/libstub/efi-stub-helper.c @@ -444,6 +444,7 @@ efi_status_t efi_exit_boot_services(void *handle, { efi_status_t status; unsigned long stall_delay = 10000000; + unsigned int repeat; efi_debug("Entered efi_exit_boot_services()\n"); efi_debug("Memory map before calling priv_func():\n"); @@ -461,6 +462,8 @@ efi_status_t efi_exit_boot_services(void *handle, efi_debug("Calling efi_bs_call(exit_boot_services, 0x%p, 0x%lx)\n", handle, *map->key_ptr); status = efi_bs_call(exit_boot_services, handle, *map->key_ptr); + for(repeat=0; repeat < 10; repeat++) { + efi_debug("Repeat attempt: %d\n", repeat); if (status == EFI_INVALID_PARAMETER) { efi_debug("efi_bs_call() returned %ld (EFI_INVALID_PARAMETER)\n", status); efi_debug("Busy Wait so you can read the ebug messages!"); @@ -503,6 +506,10 @@ efi_status_t efi_exit_boot_services(void *handle, efi_debug("Calling (again!) efi_bs_call(exit_boot_services, 0x%p, 0x%lx)\n", handle, *map->key_ptr); status = efi_bs_call(exit_boot_services, handle, *map->key_ptr); } + else { + break; + } + } /* exit_boot_services() was called, thus cannot free */ if (status != EFI_SUCCESS) diff --git a/drivers/firmware/efi/libstub/fdt.c b/drivers/firmware/efi/libstub/fdt.c index 4b66f511b050..3e993da9e6d7 100644 --- a/drivers/firmware/efi/libstub/fdt.c +++ b/drivers/firmware/efi/libstub/fdt.c @@ -298,6 +298,9 @@ efi_status_t allocate_new_fdt_and_exit_boot(void *handle, goto fail_free_new_fdt; } + efi_debug("Busy Wait so you can read the debug messages!"); + efi_bs_call(stall, stall_delay); + runtime_entry_count = 0; priv.runtime_map = runtime_map; priv.runtime_entry_count = &runtime_entry_count;