From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by mx.groups.io with SMTP id smtpd.web12.3295.1646187038106589402 for ; Tue, 01 Mar 2022 18:10:39 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="unable to parse pub key" header.i=@intel.com header.s=intel header.b=W/JSF+Dt; spf=pass (domain: intel.com, ip: 192.55.52.43, 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=1646187038; x=1677723038; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=vDSDsTSBcZNlV48lTtSnnddOlH3X7LARi60ZtBaG9n0=; b=W/JSF+DtvNw2yS9sBO7fI5OqutStMZb+0i5bmONA50uSu18shyBVoD7w 8yk8/0misJS9HRNaiT+WAxEtPfiLi2A+p/d/Jfo9nbNk7lvYj/W3ED7z+ HX8PiVFA1zpbJlztcupOD/vo5WrDLqsXoFw/QF3g0z6p3mfjNlhK/Ltuh wr+h1A+cDOYDMahwKK+6vd67vm1OEJMERxu9irsSxN8ED4gCTMzgLLJ0a d+8ejUemQMW0DozbK6/CD1beo9MzgiIryo3UZa1amDUOyhalPYK4wmCMQ q578Fx3pKyxwgR96NlYKrA13Wa589KINPH/42bUR+9zow/81bYopDvWq2 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="339720313" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="339720313" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 18:10:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="535187126" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga007.jf.intel.com with ESMTP; 01 Mar 2022 18:10:30 -0800 Received: from fmsmsx606.amr.corp.intel.com (10.18.126.86) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Tue, 1 Mar 2022 18:10:30 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21 via Frontend Transport; Tue, 1 Mar 2022 18:10:30 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.103) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 1 Mar 2022 18:10:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=eLGse8l7lFSE6OrPm/BFbfxH3JD14C8Jn3RUQbdSQxP+hGGJGEO4ZH59KT/+7BgOvdq1VTFeTK5O+ObrZEpq3MY/z7VzjHMAh2JLo4XQEJckkCgFgNNL/c6ecC8wm1JIixIAliv7hEOWVWDhWP/lPyHDdP5Nzqu4LlmGIVJYddmCfsVUTJQDQNT/lv0k1cee698UGu/8TEtRqvY8ULRbPX8dAgmRuBdHE+nxtK8AKi5VgB+Dw2MRNG9VCwaGC0qgHsHM7UrNxfYp4X7BmMHTIkfS/jr4rTam76C/VuK7P5ZLEGyRLAUl3D38wwP0X9lgKZac4VZa4SmOkKmbtxW0gA== 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=RaZwoSWKYnDIIyENHFXK/LNVGn6JD8MIVc1qPvKvV9M=; b=kq6/ECOs+nimJz+QtQnQyvRGy+2MBFD5gAY7ipSiy05ljQzDtWAxBaknJ0UwGlz1RrIjeqBF8zHt8t2tTcYNP0i4iWo8GvFBfcTlQQnBkkqL8jelrBAJD0SAH+/18k0RarES6VrxJ4tnpdcdOQuLXLojSqk/+39vsSoHoZ3238e1C4UJeNT15ponflxgnTf2RUs6tWaKyDPLFS2yiqOa357OvUW3ZuPtBRXXXf2d+CV+qAeyBB2rugyujQV1Cfk9Y766faK+TT7SKhGmV+pJqk4SrILJzTGBRiI9a2jeyT4F91tcWmX2Vmy8GZH0zkezdrSK3q2JBwB3YSPNQMnWLA== 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 SN6PR11MB3261.namprd11.prod.outlook.com (2603:10b6:805:c1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.25; Wed, 2 Mar 2022 02:10: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; Wed, 2 Mar 2022 02:10:25 +0000 From: "Wu, Hao A" To: "Rhodes, Sean" , "devel@edk2.groups.io" CC: "Dong, Guo" , "Rhodes, Sean" , "Ni, Ray" , Matt DeVillier , Patrick Rudolph Subject: Re: [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Thread-Topic: [PATCH] MdeModulePkg/Usb/Keyboard.c: Don't request protocol before setting Thread-Index: AQHYKXMQCZOwEhAz0UWdOOvbPNQ+0qyjgGsg Date: Wed, 2 Mar 2022 02:10:25 +0000 Message-ID: References: <96aee2ccd71e956372fa85cfafbf4fa03da3ae1f.1645702698.git.sean@starlabs.systems> In-Reply-To: <96aee2ccd71e956372fa85cfafbf4fa03da3ae1f.1645702698.git.sean@starlabs.systems> 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: a22d29ce-4b66-4220-2468-08d9fbf1d0dc x-ms-traffictypediagnostic: SN6PR11MB3261: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: 3/OqiRCkDXC7x66uUZrvzIYq5dF35wtY+fg+uLLiaCvFn5TYIWyosCDJbsXVwSkRZMGMH7jq5YL+jwWA7SVukO5gJ3bxTJs7FN5u1pqeShSlDQ1Lkgw/m10xdLssh1fqarsXcQMsMvIv6koOByDuJD6jJ3gZCic7/KWCnUxB1p5ibiByBw7ZhzkYVEehM6L21M/eZH+LSY20tBXtah9jBUKyCPsO3bJYAnb5/phPAyP+IkNv/G5eFZOgZDa6te9LGaG4rwXtpVuVWeyi+AYIEAWK6UXiVIiobtPHM7WTmGG4TQQVDNxaDYLNI8TGAC9YPBlc3+d2FLiyXQqd2TDQH6NrGVelAvw9whbrMZq3iKxBEs/2fgzWXcvtA+g/8CNNbP9t75uJ9ugEgHt9BNTQKNo+Z4Ln9G+bzYcn2Ro/vizld7m+ikr6zR0RtBuQXATHyAwWT2rCLRPNryHkpNd5imdoFHrQrKZ83LoW+2aA29cq1ealW5+FA+d8snhWAiG4YelNgUq5xr/WaL0jOsYcsz7weK5Mffpv/iTUwgJJGOhUs2uO1te3FEzDvlRB0moHm2fNSOMpvJO711Liq45wP2SsbGOGqd+jvJNxjlGSXD2k1u+3nwudDuqSUsz2Bu/dKAu9HAuc0P5ja6wMiu98yFhFkM50jmMb1rhFQZMwQdEmlF92t+1lDNK5id3Iz4dBiTs+Vi762zDWBicPIQYGYA== 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)(110136005)(54906003)(7696005)(33656002)(508600001)(53546011)(6506007)(71200400001)(66476007)(64756008)(66556008)(86362001)(66946007)(186003)(4326008)(66446008)(8936002)(52536014)(8676002)(2906002)(5660300002)(26005)(76116006)(83380400001)(122000001)(82960400001)(38100700002)(316002)(9686003)(38070700005)(55016003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?XUfTRx6oIU/rIqbSzH70VaTPmr9z1duyk6cRjGiDF/lBISEb6sdsT4RXD9PF?= =?us-ascii?Q?BNflTSQI+aIKWjeKqM92yUF+p40V08+OoDQAXCGkCGxklrNGrqFk1pfCBBKj?= =?us-ascii?Q?LpApq2TcUuC2EthqUjwZv4sprbdMkw1FPjQpiAf0DYE7bAFLQZmpe2ISW8oV?= =?us-ascii?Q?KB0J1CBE+GGr9X/3wMP1oLa2bt2f/PiyUUmtAuG1GzCaLCrwYwJws8qGovC6?= =?us-ascii?Q?96nXh1vq5UFeWMlKQaxiRtNSOiUELtCMh+sL/sP/sk6WO6nToze378d08l3z?= =?us-ascii?Q?EaZQjuHe4RHKZDCIe18CJVjEcBmY8PgHvfwv6mNHgZYb4siq3t5VXotmZpmy?= =?us-ascii?Q?DFfpDo9Jxeifu+ceyvJj18/sf5qQb2onl569Z9nT/4d5xhqw51EtVW4SEbEM?= =?us-ascii?Q?GXxZLQ+f4Xo1TvQiDfzc+n08MHFqE5FbAa84d2/2EyCvFMGLMfTKUvcj3iyo?= =?us-ascii?Q?sTT4H8q0FVykhMilh2W8bcjNto4u4JeMfOvOjuT6/bn03J56EqATTfszC0bt?= =?us-ascii?Q?ys1z3aNtddhD1Nb7hO77Gml3+NsuVFZ5/SB0Pez76PztmEZt+I0OewNVdna7?= =?us-ascii?Q?IGB9gX0/t4Zpp7u16f0WwOQO5mcbYZNd6FDfpI9yZZ13WkOELkSZUcctcHoh?= =?us-ascii?Q?+zVXzIlltPw/JO8CMb64a5iV7/8g7vcSLkB8Gc/Qur/j7PDplhQ2a7QCQT/Z?= =?us-ascii?Q?56YNW8dDZPL9D/Jf217ygG4YbI8gve5S68V39gjCAR6FZDWcGjjYQIs28jQu?= =?us-ascii?Q?m/+YOHk7X/uka+lTpA52jFNCnv9ix2sk3ATkhbMBBAGapLD8AHPQAdAYa9je?= =?us-ascii?Q?h9+qbLYK9LrTswbNu+f/hMPLZcr+xwZ4nzo7/iufutgQyBn/48kj6JMOSffE?= =?us-ascii?Q?4tKDGegMm/3x/t+dSErZmmGH3AgQEhAPZ1B4BLO/I2PtaUKAgJBrYuVbhdbo?= =?us-ascii?Q?4iOlMv6EjSV87NFUVO+ay6wQFMTi65RITfTkLWJ/jck5d60SGA2oUEEyCS6F?= =?us-ascii?Q?keahyhq+fuqzwrIm9f3qo9Wqt54sfewlPbL9AMAD7g90YIgORLKbQT8mOkrt?= =?us-ascii?Q?QS9XpL7PRjttssTdy0463b93yNscvSvIHY62Kq16wg9vslRiZuxluuO/QS4+?= =?us-ascii?Q?Yx8th06AHKPWNU9HCpPOfv4hq5mph4pg9frni0fed1FqF8thaLESJDbD4PXk?= =?us-ascii?Q?CaBGsgcteEP9KVdzh9Q/MW4VHi1xW1DuCbNaBmVqsyoODUQJP5oIWM2gbW52?= =?us-ascii?Q?QALYADGklMcebWn+mKfrIDqzvJQrFWf5p88bqOaHgjZOL1y8UBCaCWwa5I8K?= =?us-ascii?Q?xoMMtUr805JWsEeh5Dt1Pmjujo+tb1OIQE8HxIMiEldJPaw6E7LgYLQQQIO4?= =?us-ascii?Q?c+MmgwOmoZwucpoVNVg3lR2CUhaExgnVZKxzvUpx/pl2mWDLZ3kocydatEFa?= =?us-ascii?Q?8KRcgL4nbQ9+l5m7xK3aAllGqcay5/eWLmSSLOqqs8Cs4ggJuheY5EQC32B0?= =?us-ascii?Q?2bB2y/kps2jw+g4xGe5x4nfVGC2IzjOlRBgBHaAe9ZNd9PgVjh4OXKZR0Q+E?= =?us-ascii?Q?k5opJGmvv/F3LvE+qnjos8bzoD8VdslVMcZ/DrOsPHqJwUqrnC5uYTouWJzi?= =?us-ascii?Q?pEOlnEikKu5txyvCPOnDY7s=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: a22d29ce-4b66-4220-2468-08d9fbf1d0dc X-MS-Exchange-CrossTenant-originalarrivaltime: 02 Mar 2022 02:10:25.8789 (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: HG/13alXOOvPWd9G9PGt/VtgbTXdotgNMTSOrCnn7lLhJh9e8boTNvgR5MI8rCJqZCkMlO5DbN3yaBIUpMOZhQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB3261 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 Reviewed-by: Hao A Wu Best Regards, Hao Wu > -----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 >=20 > No need to check the interface protocol then conditionally setting, > just set it to BOOT_PROTOCOL and check for error. >=20 > 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 'GetProtocolReques= t'. >=20 > 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(-) >=20 > 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 ( > ) >=20 > { >=20 > UINT16 ConfigValue; >=20 > - UINT8 Protocol; >=20 > EFI_STATUS Status; >=20 > UINT32 TransferResult; >=20 >=20 >=20 > @@ -854,22 +853,15 @@ InitUSBKeyboard ( > } >=20 > } >=20 >=20 >=20 > - UsbGetProtocolRequest ( >=20 > - UsbKeyboardDevice->UsbIo, >=20 > - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, >=20 > - &Protocol >=20 > - ); >=20 > // >=20 > // Set boot protocol for the USB Keyboard. >=20 > // This driver only supports boot protocol. >=20 > // >=20 > - if (Protocol !=3D BOOT_PROTOCOL) { >=20 > - UsbSetProtocolRequest ( >=20 > - UsbKeyboardDevice->UsbIo, >=20 > - UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, >=20 > - BOOT_PROTOCOL >=20 > - ); >=20 > - } >=20 > + UsbSetProtocolRequest ( >=20 > + UsbKeyboardDevice->UsbIo, >=20 > + UsbKeyboardDevice->InterfaceDescriptor.InterfaceNumber, >=20 > + BOOT_PROTOCOL >=20 > + ); >=20 >=20 >=20 > UsbKeyboardDevice->CtrlOn =3D FALSE; >=20 > UsbKeyboardDevice->AltOn =3D FALSE; >=20 > -- > 2.32.0