
From: Simon Glass <sjg@chromium.org> Add this call to the bootm_final() function, dropping it from RISC-V Add a flag to ensure that cleanup_before_linux() is not called when booting an EFI app. Signed-off-by: Simon Glass <sjg@chromium.org> --- arch/riscv/lib/bootm.c | 1 - boot/bootm_final.c | 3 +++ include/bootm.h | 2 ++ lib/efi_loader/efi_boottime.c | 2 +- 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index bd47275b52e..16ded96383f 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -33,7 +33,6 @@ DECLARE_GLOBAL_DATA_PTR; static void announce_and_cleanup(int fake) { bootm_final(fake); - cleanup_before_linux(); } static void boot_prep_linux(struct bootm_headers *images) diff --git a/boot/bootm_final.c b/boot/bootm_final.c index 7f069877d06..bf53c112c19 100644 --- a/boot/bootm_final.c +++ b/boot/bootm_final.c @@ -31,4 +31,7 @@ void bootm_final(enum bootm_final_t flags) * of DMA operation or releasing device internal buffers. */ dm_remove_devices_active(); + + if (!(flags & BOOTM_FINAL_NO_CLEANUP)) + cleanup_before_linux(); } diff --git a/include/bootm.h b/include/bootm.h index 6d37d299342..7c74b6c406d 100644 --- a/include/bootm.h +++ b/include/bootm.h @@ -21,9 +21,11 @@ struct cmd_tbl; * * @BOOTM_FINAL_FAKE: true to do everything except actually boot; it then * returns to the caller + * @BOOTM_FINAL_NO_CLEANUP: true to skip calling cleanup_before_linux() */ enum bootm_final_t { BOOTM_FINAL_FAKE = BIT(0), + BOOTM_FINAL_NO_CLEANUP = BIT(1), }; /** diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c index d90f9020ccb..2a02029f243 100644 --- a/lib/efi_loader/efi_boottime.c +++ b/lib/efi_loader/efi_boottime.c @@ -2231,7 +2231,7 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle, if (!efi_st_keep_devices) { bootm_disable_interrupts(); board_quiesce_devices(); - bootm_final(0); + bootm_final(BOOTM_FINAL_NO_CLEANUP); } /* Patch out unsupported runtime function */ -- 2.43.0