Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions libkernelflinger/android.c
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
EFI_PHYSICAL_ADDRESS kernel_start)
{
EFI_STATUS ret = EFI_LOAD_ERROR;
UINTN map_key, i;
UINTN map_key, i, j;

log(L"handover jump ...\n");

Expand All @@ -453,7 +453,7 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
* Hence, we give two chances to ExitBootServices() to
* succeed.
*/
for (i = 0; i < 2; i++) {
for (i = 0; i < 10; i++) {
ret = setup_memory_map(boot_params, &map_key);
if (EFI_ERROR(ret)) {
efi_perror(ret, L"Failed to setup memory map");
Expand All @@ -464,10 +464,16 @@ static inline EFI_STATUS handover_jump(EFI_HANDLE image,
* ExitBootServices() call or memory_map key might mismatch
* and ExitBootServices call might fail.
*/

j=0;
ret = uefi_call_wrapper(BS->ExitBootServices, 2, image, map_key);
if (!EFI_ERROR(ret))
goto boot;
/* FixMe: Temporary change to fix RAM instability by adding
* delay in few MTL Boards. This change needs to be reworked.
*/
do{
j+=1;
}while(j<2000);
}

return ret;
Expand Down