summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichael Brown2020-09-29 22:13:10 +0200
committerMichael Brown2020-09-29 22:21:04 +0200
commit8344803c934c71c7eebb6b706d73a8c00d57b713 (patch)
tree99c76a10d605635eeba536def8e9b1efd41d9682 /src
parent[usb] Show debug message on device removal (diff)
downloadipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.tar.gz
ipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.tar.xz
ipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.zip
[efi] Disconnect controllers before uninstalling EFI_USB_IO_PROTOCOL
The call to UninstallMultipleProtocolInterfaces() will implicitly disconnect any relevant controllers, and there is no specified requirement to explicitly call DisconnectController() prior to callling UninstallMultipleProtocolInterfaces(). However, some UEFI implementations (observed with the USB keyboard driver on a Microsoft Surface Go) will fail to implicitly disconnect the controller and will consequently fail to uninstall the protocols. The net effect is that unplugging and replugging a USB keyboard may leave the keyboard in a non-functional state. Work around these broken UEFI implementations by including an unnecessary call to DisconnectController() before the call to UninstallMultipleProtocolInterfaces(). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src')
-rw-r--r--src/interface/efi/efi_usb.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/interface/efi/efi_usb.c b/src/interface/efi/efi_usb.c
index f280a681b..bac2d053a 100644
--- a/src/interface/efi/efi_usb.c
+++ b/src/interface/efi/efi_usb.c
@@ -1193,6 +1193,12 @@ static void efi_usb_uninstall ( struct efi_usb_interface *usbintf ) {
DBGC ( usbdev, "USBDEV %s uninstalling %s\n",
usbintf->name, efi_handle_name ( usbintf->handle ) );
+ /* Disconnect controllers. This should not be necessary, but
+ * seems to be required on some platforms to avoid failures
+ * when uninstalling protocols.
+ */
+ bs->DisconnectController ( usbintf->handle, NULL, NULL );
+
/* Uninstall protocols */
bs->UninstallMultipleProtocolInterfaces (
usbintf->handle,