From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web11.8048.1646288851354172807 for ; Wed, 02 Mar 2022 22:27:31 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=I0sCkrR6; spf=pass (domain: intel.com, ip: 192.55.52.88, mailfrom: hao.a.wu@intel.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1646288851; x=1677824851; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=oSJRYo2brznRvbhSgyoAl/wXmNj6Xu0uuVKrmocsSec=; b=I0sCkrR6+zIa7EVig3NP7KK+araCpwBRmx3ecavQkExWMWeY+l7Nk34p 1BKxkMgn7NI9hniL8wVTplVPcwoi/E3e/lTU2A/J6FA9YEeQLmDH1v/SJ UrREHStz6JCzQcrs1mpDI9VbW2E/2Ym3t4WAiSeg0TV1hZjViJJTBIw7A 4WZVwMrQccwjoiZYvYkG56uFqBWsyAgtbnJ/24NXsUFdVMuQ8erR9E64x N+4NMlQtPEBbE/WJw6i5CfmRzZoQpzMD+J1Kp2cbHWpIClaPbESvlL/7k B7OARvLL48gapkPpTTc9kDya1IQZLBuHsR4u8BJHXFgXx06eDaUBgXWEw Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10274"; a="278271742" X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="278271742" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2022 22:27:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,151,1643702400"; d="scan'208";a="535695819" Received: from fmsmsx603.amr.corp.intel.com ([10.18.126.83]) by orsmga007.jf.intel.com with ESMTP; 02 Mar 2022 22:27:29 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 2 Mar 2022 22:27:29 -0800 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Wed, 2 Mar 2022 22:27:29 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Wed, 2 Mar 2022 22:27:29 -0800 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (104.47.58.101) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.21; Wed, 2 Mar 2022 22:27:28 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YbGT8yYb4PqC+JxMnEn1dQrFu0l/NLNFb3BiDiky0moTn4u0jZDtYOt2YMaDhJqgbsPHgQvkYN/dOp+si73N3NPMRAusBQKc3j5FiloXa7Nc7GS2ISuDVGrJ45H6pF85lDAl5Ljv7M7tj7q4cisJI7IznTMZINRUY1vEZFez+k80tXWNtwympp2eGoNo+tSTFfU9MlrgyUcyHBHp00rDIGG3/NJhtl3wXcDseqrPyDUvGPRVxJgI9pmbTBxxuMbhXDDllwcEa05M8R3gBg+ssm2dYdhft3CHgQs/qu9TMaxUZCX/09f1j90rnKmstLHWaY7AyVvTe2bLW5noX/eWSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=UHSmUW2tNFEXMLcG99jkGhkiP6dRNOLDGIsc9QQGKv4=; b=dR86FhA5tw+K4Z1N4R/bMmqcF8BGQIrhyCrlHeVDztLGCScQwK7++AWS1pbRBEIOGo1XJ1kdFWK3PxD71ePMRGIUtZ34cE4unEeE6a/xmHHNpenZt9mnu4QVxcWawV9mM4hTNVBngKw4ipU7BVp37nCisQmjhalYRDxHooBmmlEVnM0R4VzHzWb/4TuI+qAdNeOwdSluYTfoRYTJEubXGYXp9wbYvLVoHMkKNpzDaLv20SengZ1dHbPtAK1CfLpLw/gLKOoTQLBjcSkAl7Z7q94MAvX5f6YdzR2YbzxZJTgzPwX3/gVxqQHvOiUcWFzDVFZwg2mGRU+FL7gzGG34hg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from DM6PR11MB4025.namprd11.prod.outlook.com (2603:10b6:5:197::31) by DM6PR11MB3756.namprd11.prod.outlook.com (2603:10b6:5:136::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.26; Thu, 3 Mar 2022 06:27:26 +0000 Received: from DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::2dd0:9ba8:a8c:fc96]) by DM6PR11MB4025.namprd11.prod.outlook.com ([fe80::2dd0:9ba8:a8c:fc96%3]) with mapi id 15.20.5017.027; Thu, 3 Mar 2022 06:27:26 +0000 From: "Wu, Hao A" To: "devel@edk2.groups.io" , "Wu, Hao A" , "Rhodes, Sean" CC: "Dong, Guo" , "Ni, Ray" , "Matt DeVillier" , Patrick Rudolph Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Thread-Index: AQHYKXMQCZOwEhAz0UWdOOvbPNQ+0qyjgGsggAm8AUA= Date: Thu, 3 Mar 2022 06:27:26 +0000 Message-ID: References: <96aee2ccd71e956372fa85cfafbf4fa03da3ae1f.1645702698.git.sean@starlabs.systems> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.5.1.3 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5fcb0e07-685a-4aac-df26-08d9fcdee27a x-ms-traffictypediagnostic: DM6PR11MB3756:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5mauyPysTcrLPrHUR2rqsulb2M4fi8dD7ISF4XmMaSqftZCmw/U/Nmn4AlRtxxQLyhjtzjBTD9f4b4SPh+jcwdI4hD8dr2hIldzkhYRsbdHjdEkdPO/Zvl9EGIwaAMqaYSadrL7LA3RBTVZfIZD94/coXhz1mIpxdWvwXzH2/gE2Z35u91h1qsiEBbfdgnAU8wXBM9t+RvDYULCBLBok7S8/H/Ow1RjBdqCuZcfaE2/hpr+J0MeDieCfuRw6bPA+NpNHzh3pxuzHRSzJGUbZn12KQ3LzHzEcsMvGO1/9ibEejM2AlyRt6dySdT2UQP6JNWamP2QGKDgLE20BrRszOBWJb/FYqNbLsenXLcm4VfA6HdmcRF6C3frDq6qzvsNU4BOzWr38SvrtvaD15VyKdDHFkidAieBylmZ6fpt61KJCZ+rQA3lgSC3s2+giai8k71WwiN+FhvFESfCY4kbu/HD6yJU9lkPo4Wyh/3AL135kEzkYhIqH2w/9k6S+V+JNx/raW83O6uHsULwYB+TNfVX7h2VnKagvfHAZZex9SYfEvUczeCspt/xD4gyrCCqWY2clq9R99o6nU5Y44uArdTADxxXIjuaxJii3+eM0br9Bivj1QIU7OPuoK/2dPyNBgzlMSFPH32NxSiGCh4KW+S6P96fyWYIyrpUqopvg5ilHZYCoe7D5Q8DRnVUoX7RXdU6IsKHkmfJ3X14G0TjqQOmBEbfFTI7Sac5bvjYaxkrZmv4yvkuky9WQu8dCBwUoZcKWUPv+HTvCc8KdlMqtzax3xOaO5j9WQWxhRk1sQZk8mAZC0X1+851W6jdyzUuMmvcqYKnRJKVlAyMR8QlYRw== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR11MB4025.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(366004)(64756008)(66946007)(66446008)(6506007)(66556008)(7696005)(82960400001)(66476007)(86362001)(316002)(110136005)(38070700005)(508600001)(76116006)(966005)(54906003)(53546011)(186003)(38100700002)(71200400001)(26005)(83380400001)(122000001)(55016003)(5660300002)(4326008)(2906002)(52536014)(8936002)(33656002)(9686003)(8676002);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?99HTzKtYBdwP//WAFjEkH0AzAS5QKV2K7bHmOlmaOperEN1VzEFKlJJesMSM?= =?us-ascii?Q?HxjgKRwCo6vr6esPZi7nRDQd2TRIEEzpBp++JRIRUxRntIN2dzlS7M1MevMW?= =?us-ascii?Q?26A0Ouivwkj9peavNjThbZbP23SL9SUaa2bYE7eP6/nUfgc1eBc0h8QRfHe/?= =?us-ascii?Q?ha89wI7Xo8VbjygtfP5wfgJ1SelQzmp6+YZ5g9v3BZE7bR6m5JucwFVuKnbR?= =?us-ascii?Q?gGbwGBIgnl/KI8VeMZgH937D/OnQWXZPpZufNdNuE/6RUJbGdxD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xMgyulcu5qJtHASR53L7pCGQUTtJMXwcBpHuFP9L0CoXQPVMp?= =?us-ascii?Q?xft6FU/c8PP7AQsJNpiAA3qccxK0ozzPKFhRaAG0i01t6fdBpTxGgVbPuhl/?= =?us-ascii?Q?1itT6kMVUB5requ+1XappSVa6dPQszNHo+tOpNO0vmarGfN2VXzZqWm/rpDo?= =?us-ascii?Q?LQZJnUICOS9ho6ZjPLyhbD8PE45WU3tEn0LsHV6cxjBcRn0AzzwlWDmtv0s2?= =?us-ascii?Q?+iN2TEpeKyDvJQ1ux8JstIG0wh0mcVwaEa/iqCwSQkmJNMQRqOVdmX6wVCmn?= =?us-ascii?Q?F9X550jyGozGjf8A3BRCVlYg4OuUbW+BA70b8x6IFk6pQ+/1X+DlOlgJ/Blx?= =?us-ascii?Q?IO2J7Qf7n27d57nh4peKRYVjLSwHZzVT6DinZgQ0uebAE0NnhB4bBOBHXLDV?= =?us-ascii?Q?fXH6Cki5bJs5zx8gfPGS/3Tdkr25jyIrme9ynOt4iGJ3XgZ708sn/lmwKElR?= =?us-ascii?Q?cBHn1NmQQYgH7gkPlQux1YM=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4025.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5fcb0e07-685a-4aac-df26-08d9fcdee27a X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Mar 2022 06:27:26.1497 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 8wV/FQ6OUfxljlRwIBKRxTx5uddRbAue+ptGnIP6fAVVgWI9pVMD/4ACW81ps4LYqlMs7eJk5LEU2zd/BnXuDQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3756 Return-Path: hao.a.wu@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Pushed via: PR - https://github.com/tianocore/edk2/pull/2574 Commit - https://github.com/tianocore/edk2/commit/589d51df260465e2561979b8a= 988e77b0f32a6e8 Best Regards, Hao Wu > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Wu, Hao > A > Sent: Wednesday, March 2, 2022 10:10 AM > To: Rhodes, Sean ; devel@edk2.groups.io > Cc: Dong, Guo ; Rhodes, Sean > ; Ni, Ray ; Matt DeVillier > ; Patrick Rudolph > > Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't > request protocol before setting >=20 > Reviewed-by: Hao A Wu >=20 > Best Regards, > Hao Wu >=20 > > -----Original Message----- > > From: Sean Rhodes > > Sent: Thursday, February 24, 2022 7:38 PM > > To: devel@edk2.groups.io > > Cc: Dong, Guo ; Rhodes, Sean > > ; Wu, Hao A ; Ni, Ray > > ; Matt DeVillier ; Patrick > > Rudolph > > Subject: [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol > > before setting > > > > 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 sp= ec. > > 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 | 18 +++++------------- > > 1 file changed, 5 insertions(+), 13 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c > > b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c > > index 5a94a4dda7..b5a6459a35 100644 > > --- a/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c > > +++ b/MdeModulePkg/Bus/Usb/UsbKbDxe/KeyBoard.c > > @@ -805,7 +805,6 @@ InitUSBKeyboard ( > > ) > > > > { > > > > UINT16 ConfigValue; > > > > - UINT8 Protocol; > > > > EFI_STATUS Status; > > > > UINT32 TransferResult; > > > > > > > > @@ -854,22 +853,15 @@ InitUSBKeyboard ( > > } > > > > } > > > > > > > > - 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 > > > > + ); > > > > > > > > UsbKeyboardDevice->CtrlOn =3D FALSE; > > > > UsbKeyboardDevice->AltOn =3D FALSE; > > > > -- > > 2.32.0 >=20 >=20 >=20 >=20 >=20