[PATCH 002/112] commands: efiexit: flush console and shutdown barebox
Ahmad Fatoum
a.fatoum at pengutronix.de
Wed Jan 3 10:11:22 PST 2024
barebox as EFI payload may have direct device access over PCI. These
devices may be doing DMA and need to be quiesced before barebox returns
control to the EFI loader. Therefore start calling shutdown_barebox()
in the efiexit path.
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
common/efi/payload/init.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/common/efi/payload/init.c b/common/efi/payload/init.c
index cfacdffa6761..ffa466e3ad44 100644
--- a/common/efi/payload/init.c
+++ b/common/efi/payload/init.c
@@ -428,16 +428,23 @@ late_initcall(efi_late_init);
static int do_efiexit(int argc, char *argv[])
{
+ console_flush();
+
+ if (!streq_ptr(argv[1], "-f"))
+ shutdown_barebox();
+
return BS->exit(efi_parent_image, EFI_SUCCESS, 0, NULL);
}
BAREBOX_CMD_HELP_START(efiexit)
-BAREBOX_CMD_HELP_TEXT("Leave barebox and return to the calling EFI process\n")
+BAREBOX_CMD_HELP_TEXT("Options:")
+BAREBOX_CMD_HELP_OPT("-f", "force exit, don't call barebox shutdown")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(efiexit)
.cmd = do_efiexit,
- BAREBOX_CMD_DESC("Usage: efiexit")
+ BAREBOX_CMD_DESC("Leave barebox and return to the calling EFI process")
+ BAREBOX_CMD_OPTS("[-flrw]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_efiexit_help)
BAREBOX_CMD_END
--
2.39.2
More information about the barebox
mailing list