From nobody Sun Nov 24 13:24:09 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+86756+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86756+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1645169381; cv=none; d=zohomail.com; s=zohoarc; b=Uc5IS43wNjAcq2HL0PI0arICX8XEP8khjOFWct82WrMiKkAwMjifV2HzWM4lqr6oOiwTyBnw8MvhOHVJlRKIuQ/tVrW/4YJMt5+rJ5sVHzNr5LRzcmPiTcO5Azbxa+rv/TjyNDS5upW1l1i5ewE0oUfVGbX8JOaYtxq401dODXA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1645169381; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=oqy4Dq6+5orIkRb/VV0ItqGIQ1uaQ1/Mo1bKo/FmQ2E=; b=bHzzPfSLp+7r1t0WPQQxdRyv4yTsfQAVwYmyBxHOFs29xs3cYSb8iUj7fnVZeEuOAtqq67PZPxhfNWszFln58N2z1W8zSwPZMtmq9z1UPn23UMxZySbenVz6WpXNlAOiZErExJI3Ojp/7M746NmTA/fadCMSCgFVkrpkQ2NR0Bk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+86756+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1645169381234162.66188240183783; Thu, 17 Feb 2022 23:29:41 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id YY0xYY1788612xs4EeCMVwZG; Thu, 17 Feb 2022 23:29:40 -0800 X-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 X-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: [edk2-devel] [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Date: Fri, 18 Feb 2022 07:29:32 +0000 Message-Id: MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,sean@starlabs.systems X-Gm-Message-State: D4yD5BEPwDIc5NuBaACB1ZIfx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1645169380; bh=LFyNzNHrZwv6snfbnTV0UpiwPwwRf3B05sZpuvBu3dw=; h=Cc:Date:From:Reply-To:Subject:To; b=AsamVd5vpL6KT8DZTxHK1Y+fcB5LBJbpHzw+iD7XUJcid25rpG2tODZHMwvVCBVWBOf zt8/ZMxbEsZ/oOEuOmmHzghzUcHiZg7+0Djx2mNnXD55i1QAPNRYF3La6VVSo0Hdys66+ bjKjMgD5oPi7EHgkZZ/nH3WnKyNEPmTCoU8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1645169382098100001 Content-Type: text/plain; charset="utf-8" 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 ( } } =20 - UsbGetProtocolRequest ( - UsbKeyboardDevice->UsbIo, - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, - &Protocol - ); // // Set boot protocol for the USB Keyboard. // This driver only supports boot protocol. // - if (Protocol !=3D BOOT_PROTOCOL) { - UsbSetProtocolRequest ( - UsbKeyboardDevice->UsbIo, - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, - BOOT_PROTOCOL - ); - } + UsbSetProtocolRequest ( + UsbKeyboardDevice->UsbIo, + UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, + BOOT_PROTOCOL + ); =20 UsbKeyboardDevice->CtrlOn =3D FALSE; UsbKeyboardDevice->AltOn =3D FALSE; 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 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#86756): https://edk2.groups.io/g/devel/message/86756 Mute This Topic: https://groups.io/mt/89228276/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-