From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.ixn.mail.zen.net.uk (smarthost01b.ixn.mail.zen.net.uk [212.23.1.21]) by mx.groups.io with SMTP id smtpd.web11.8259.1645169379320493868 for ; Thu, 17 Feb 2022 23:29:39 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.21, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=sean-StarBook.lan) by smarthost01b.ixn.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1nKxhu-0003h6-Nn; Fri, 18 Feb 2022 07:29:34 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: guo.dong@intel.com, Sean Rhodes , Hao A Wu , Ray Ni , Matt DeVillier , Patrick Rudolph Subject: [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Date: Fri, 18 Feb 2022 07:29:32 +0000 Message-Id: X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable No need to check the interface protocol then conditionally setting, just set it to BOOT_PROTOCOL and check for error. This is what Linux does for HID devices as some don't follow the USB spec. One example is the Aspeed BMC HID keyboard device, which adds a massive boot delay without this patch as it doesn't respond to 'GetProtocolRequest'. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Matt DeVillier Signed-off-by: Patrick Rudolph Signed-off-by: Sean Rhodes --- MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c | 17 +++++------------ .../Library/BrotliCustomDecompressLib/brotli | 2 +- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c b/MdeModulePkg/Bus/Us= b/UsbKbDxe/KeyBoard.c index 5a94a4dda7..73b5df2b64 100644 --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c @@ -854,22 +854,15 @@ InitUSBKeyboard ( }=0D }=0D =0D - UsbGetProtocolRequest (=0D - UsbKeyboardDevice->UsbIo,=0D - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,=0D - &Protocol=0D - );=0D //=0D // Set boot protocol for the USB Keyboard.=0D // This driver only supports boot protocol.=0D //=0D - if (Protocol !=3D BOOT_PROTOCOL) {=0D - UsbSetProtocolRequest (=0D - UsbKeyboardDevice->UsbIo,=0D - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,=0D - BOOT_PROTOCOL=0D - );=0D - }=0D + UsbSetProtocolRequest (=0D + UsbKeyboardDevice->UsbIo,=0D + UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber,=0D + BOOT_PROTOCOL=0D + );=0D =0D UsbKeyboardDevice->CtrlOn =3D FALSE;=0D UsbKeyboardDevice->AltOn =3D FALSE;=0D diff --git a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli b/MdeMod= ulePkg/Library/BrotliCustomDecompressLib/brotli index f4153a09f8..666c3280cc 160000 --- a/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli +++ b/MdeModulePkg/Library/BrotliCustomDecompressLib/brotli @@ -1 +1 @@ -Subproject commit f4153a09f87cbb9c826d8fc12c74642bb2d879ea +Subproject commit 666c3280cc11dc433c303d79a83d4ffbdd12cc8d --=20 2.32.0