aboutsummaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2020-09-29 21:13:10 +0100
committerMichael Brown <mcb30@ipxe.org>2020-09-29 21:21:04 +0100
commit8344803c934c71c7eebb6b706d73a8c00d57b713 (patch)
tree99c76a10d605635eeba536def8e9b1efd41d9682 /src/interface
parent8eb19a178a5d6ca89ca2b8200dae0f7cec15ae2c (diff)
downloadipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.zip
ipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.tar.gz
ipxe-8344803c934c71c7eebb6b706d73a8c00d57b713.tar.bz2
[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/interface')
-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 f280a68..bac2d05 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,