[efi] Drop to external TPL for calls to ConnectController()

There is nothing in the current versions of the UEFI specification
that limits the TPL at which we may call ConnectController() or
DisconnectController().  However, at least some platforms (observed
with a Lenovo ThinkPad T14s Gen 5) will occasionally and unpredictably
lock up before returning from ConnectController() if called at a TPL
higher than TPL_APPLICATION.

Work around whatever defect is present on these systems by dropping to
the current external TPL for all calls to ConnectController() or
DisconnectController().

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2025-07-14 12:17:11 +01:00
parent c01c3215dc
commit c3376f8645
7 changed files with 125 additions and 41 deletions

View File

@@ -413,6 +413,8 @@ extern int efi_open_by_child_untyped ( EFI_HANDLE handle, EFI_GUID *protocol,
EFI_HANDLE child, void **interface );
extern void efi_close_by_child ( EFI_HANDLE handle, EFI_GUID *protocol,
EFI_HANDLE child );
extern int efi_connect ( EFI_HANDLE device, EFI_HANDLE driver );
extern int efi_disconnect ( EFI_HANDLE device, EFI_HANDLE driver );
/**
* Test protocol existence

View File

@@ -86,6 +86,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#define ERRFILE_null_smbios ( ERRFILE_CORE | 0x002e0000 )
#define ERRFILE_efi_open ( ERRFILE_CORE | 0x002f0000 )
#define ERRFILE_efi_table ( ERRFILE_CORE | 0x00300000 )
#define ERRFILE_efi_connect ( ERRFILE_CORE | 0x00310000 )
#define ERRFILE_eisa ( ERRFILE_DRIVER | 0x00000000 )
#define ERRFILE_isa ( ERRFILE_DRIVER | 0x00010000 )