aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-11-19 16:33:04 -0500
committerHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2021-11-26 21:30:59 +0100
commit3f73e79de83ecc78b9a9c823b8118ab1fba63b0a (patch)
treed3b80228bd654900749464871e8bac3ff5b1f10f
parent2ad8d0cb950da2233a2ec030533f4e54c6d04126 (diff)
downloadu-boot-3f73e79de83ecc78b9a9c823b8118ab1fba63b0a.zip
u-boot-3f73e79de83ecc78b9a9c823b8118ab1fba63b0a.tar.gz
u-boot-3f73e79de83ecc78b9a9c823b8118ab1fba63b0a.tar.bz2
efi: Call bootm_disable_interrupts earlier in efi_exit_boot_services
If we look at the path that bootm/booti take when preparing to boot the OS, we see that as part of (or prior to calling do_bootm_states, explicitly) the process, bootm_disable_interrupts() is called prior to announce_and_cleanup() which is where udc_disconnect() / board_quiesce_devices() / dm_remove_devices_flags() are called from. In the EFI path, these are called afterwards. In efi_exit_boot_services() however we have been calling bootm_disable_interrupts() after the above functions, as part of ensuring that we disable interrupts as required by the spec. However, bootm_disable_interrupts() is also where we go and call usb_stop(). While this has been fine before, on the TI J721E platform this leads us to an exception. This exception seems likely to be the case that we're trying to stop devices that we have already disabled clocks for. The most direct way to handle this particular problem is to make EFI behave like the do_bootm_states() process and ensure we call bootm_disable_interrupts() prior to ending up in usb_stop(). Cc: Ilias Apalodimas <ilias.apalodimas@linaro.org> Cc: Heinrich Schuchardt <xypron.glpk@gmx.de> Cc: Simon Glass <sjg@chromium.org> Suggested-by: Ilias Apalodimas <ilias.apalodimas@linaro.org> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
-rw-r--r--lib/efi_loader/efi_boottime.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
index 6fdd0ef..8492b73 100644
--- a/lib/efi_loader/efi_boottime.c
+++ b/lib/efi_loader/efi_boottime.c
@@ -2167,6 +2167,7 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
}
if (!efi_st_keep_devices) {
+ bootm_disable_interrupts();
if (IS_ENABLED(CONFIG_USB_DEVICE))
udc_disconnect();
board_quiesce_devices();
@@ -2179,9 +2180,6 @@ static efi_status_t EFIAPI efi_exit_boot_services(efi_handle_t image_handle,
/* Fix up caches for EFI payloads if necessary */
efi_exit_caches();
- /* This stops all lingering devices */
- bootm_disable_interrupts();
-
/* Disable boot time services */
systab.con_in_handle = NULL;
systab.con_in = NULL;