From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 8D0B394161E for ; Mon, 16 Oct 2023 13:23:36 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nvwhsPmS5//DPR0Dz+bhGzeLnKTtOkrzGNSbRDGzzWc=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type; s=20140610; t=1697462615; v=1; b=dnr5PjHr31HVThTNc6h0lZqf9UJ1oMkxoS7mDi4B537ny82nx3ihxZ6OsJ/NJEegC5II0bIX De2ju64qdi4BlD9krx+pgobXTVMevKZOkdGjspKc8JucOYPZ2vzO8lyX0Vddi+3afHWCTEov0eo PZ4EXTDF+m5BcIxhOcpPHSqg= X-Received: by 127.0.0.2 with SMTP id kzzjYY7687511xtyiWN3x3AN; Mon, 16 Oct 2023 06:23:35 -0700 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (NAM11-CO1-obe.outbound.protection.outlook.com [40.107.220.62]) by mx.groups.io with SMTP id smtpd.web10.123930.1697462614395017476 for ; Mon, 16 Oct 2023 06:23:34 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mXMXlbRE/2EZzOpv63v6D7wl/KgViDIxX8cwtyPZvON1Uin4eV5Unvt6m8Go+ZKAp/aPenAXlwn85hrqlnVDDydaU36hXlvaS2aTLrkS5Cdbff+GmDFdArsxAg9FLNY9LeNBBZLZzem1JcHvhOS28BgLH/870c/j2kL2+R79tzw4o8b25TssVUWYPMbpyVdHUZPibYBDsdx1UytvyxpHWImdJAYnYHM5oldm+AvlOiApCN9HEe0xU3i68PqNCDfhu44COAaMV0XotY0YP3sT18ty3qu7it8mB8yGDJta0cRQSUygdnpdQG53SuIyILmgY+qbOFsr60ceaAWINCEnaA== 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=jPurssbyJarF512uLjMRHCl50cA2YNq0kCR0aPqhYpQ=; b=T1cBYp1GjAIG9lQSfdafhAC3DiiCdNGFopiwb3ulFrWj0rS1yybsKh40oqADaauFg6gKfuvgXXsCfHRvYgyu0v+2ZaEz5QKu3Iv+xVO5eGefKvA1BOCQGpO5Am9uUVtgvDnrqKrjTiEng5G9glo+YRF+16Vr1JooCnyDJoSwp6vsjU07DEgcoT/8zgoqCzcP4ZWrL0RoRS/Fbm9Q9L1OH8bxxJRt0D4w33wYyzt3pY+lkdqk+ErGGFYcDgipL+0Sk2AI9yi44h6aKw5MD6FWn02U9xVKA1FGIvL0ImqQhogCy4g8Vr9eobafqtKdAA5Ha0zoh8p0K9kN6zQxvPNguA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none X-Received: from IA1PR12MB6068.namprd12.prod.outlook.com (2603:10b6:208:3ec::10) by DS0PR12MB8575.namprd12.prod.outlook.com (2603:10b6:8:164::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6886.35; Mon, 16 Oct 2023 13:23:31 +0000 X-Received: from IA1PR12MB6068.namprd12.prod.outlook.com ([fe80::3617:be5:b6c0:6967]) by IA1PR12MB6068.namprd12.prod.outlook.com ([fe80::3617:be5:b6c0:6967%6]) with mapi id 15.20.6886.034; Mon, 16 Oct 2023 13:23:30 +0000 From: "Chesley, Brit via groups.io" To: "devel@edk2.groups.io" , "hao.a.wu@intel.com" , Ashish Singhal , Rick Tseng , "Ni, Ray" , "Wang, Jian J" , "Gao, Liming" CC: Jeff Brasen Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port reset Thread-Topic: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after port reset Thread-Index: AQHZ78UeAkoN8IeFXEO8LSKtgPxdNrBHFiEAgASxs4CAAL3CkA== Date: Mon, 16 Oct 2023 13:23:30 +0000 Message-ID: References: <363ba9c963a54eab7ba740c3a22fd12f3f2edfc0.1695606406.git.rtseng@nvidia.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: msip_labels: MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ActionId=d2954905-25e0-453a-8b2c-2d98436b5ee0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_ContentBits=0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Enabled=true;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Method=Privileged;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_Name=Public-AIP 2.0;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SetDate=2023-10-16T13:14:15Z;MSIP_Label_d4243a53-6221-4f75-8154-e4b33a5707a1_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: IA1PR12MB6068:EE_|DS0PR12MB8575:EE_ x-ms-office365-filtering-correlation-id: 733fb50b-c4fc-46f7-e70e-08dbce4b171d x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: qcsK05NRfN65hdW3BHMlI6viApwfKwQYonmg6ZGQB0kX8wVB5xEXiM7lJbmhGnivCc2p4PN36qOxp5vum53S9X2VR6/CGKOmBJnydDliNHT2kx7zG7IA+LvxB4/6NErRbYPIKeSX+AL2s9iYtm8gV7KdgTD2PcaZMXTT1bET16o+sFfcCcYWfuVqrzxexTIDkAmckzDbXnEfTG7wUyTOIVDYu1fvP9P1fRjBiR9iv4hlFSQCv2wFt46K3zstCf6P8krFhJ6WGsnwc6Tn8MvTzHtVMRz3TgdViXEiX7bj3KaARefNjEtmjuzGvf+lQB7pTUjw8nFGf3Lo+QQPZFmro16ytAF4EKXb3LDhNVW6schuI358T72USynLgI4EEvk/xTHa+cXWoBMmjLEAc2pesfgyiJHDXOHv2Sy6eAfW1a41ykxzkuO3oGG8l2wOLS0PQjAAzs+dEUgYa4i4BOcadr/TeKOsnjF1IgAtlzK6WUoqM7AF6JzDEVNYAlo2CQJxiMUixeLTFW8vX9y2sXmRdHZgnS3yMTGUAhYz4ZGReLB9bIBWnCqSP318LH+v3jWTtUZVv1pR7ZarjE2/ChTbqWWZGCZlFYGH6sFZoyuqhWSsl9+ahGMxsPqzTYGrEN7K x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?PiXPhs32rQr9H43SqZbWQ70OCMb8Wt2QeeR/Ueynm+eIg8bDcUNPEmjvI6UH?= =?us-ascii?Q?gsdMwISteYUzvXaZI3WYRyoryPVZZTimmErr+79KmHQl1hdaAVusK3sPEury?= =?us-ascii?Q?YYdoOg8o8uFuOLYbEiAOxsqIgSrBSPWH3nKVYXqzwXbEN/f2P0vmGQijfuro?= =?us-ascii?Q?Vqe/dB9oYBVvzrYMr5yDiT5SdPbbLvWxc2OTH3rJHuip5blyTckxdfJuF0fr?= =?us-ascii?Q?bsRdZiwUGVVF+cUXSmvryIXimZJNLf/v9Bz5cfAItRWwpHU+T1zCBWjqPCkw?= =?us-ascii?Q?rPrZypVgVtcjabDgHiwvChejer5LSn+YVvtugxFywpbZcZC7gWKdKaoLhw4U?= =?us-ascii?Q?XORA4RsWlEU3yRsKl1GqL3w48j9TpPzH+JyfcBDF0aBdKOQRMIIzzl2smpDd?= =?us-ascii?Q?2Lr9RGZMQ/C7qdeLDRmPMCGd5J9bEm/1OYLDf9vzhkij6PIOrKHyuOAUjKMf?= =?us-ascii?Q?+yyeDD3Qxy4fn7F9tRPGcbswHjwwdlsfFhcDW1pMjpQLAzZYlgtsTqcEhX3P?= =?us-ascii?Q?dqO0bOaJKanGD7V+eIBnFUAYHRuWoF63tfzzRu8jlr5vtPTW0KxFsnQO0O6B?= =?us-ascii?Q?89wQMRuhfKMJ4rxn8LDqVljt4S+KQq5SdIxSq0OQwhN8Azxvby3XbhNePIDi?= =?us-ascii?Q?7bfdO3CzNpCCOp26xxMQWAENFwCEfBSIOKV37g1+TIisgndutRQV8omPvAyb?= =?us-ascii?Q?o1dBGYuS092ST8DiTLQFA9FPrDspD9td9zPdZjxzQa04pYb/5XOcHobvjB1b?= =?us-ascii?Q?OibajXU4Sk9wSlFBZUgT6CefgHLMyJFjioA49HR641TEszzG7VYjsiUo0+e6?= =?us-ascii?Q?m23Jcf9cdRJ9MJEzjgFB3Cya/zixkPLSg5ilb7MhQTwzLi5RKfVu5Bao1O/J?= =?us-ascii?Q?WEa4SfUmKzFpcqmYRAy1YbXR0BWyOkyOMIfuEyM+P8j9+fgFgodsJU632OKj?= =?us-ascii?Q?5Ey3S1sdyL1/d3mPo2AwGZ8lfwONXOSaGjcGIFM/wfrz1sAytVnwYcczL6Jd?= =?us-ascii?Q?yUrbUtdtCywJ8T1H0S6zzxjJ8eU/dxxlpWDeNIEfTwhZ5Igmu1qVm3Ts830E?= =?us-ascii?Q?ULztosjbUtV8I8FPft5H0bVVexnECptIQuhvpyIfXi/Xi8LMsKK/SEc3Qywz?= =?us-ascii?Q?IWrBpjSE0UcQLhuGgaubeAdlZJZSURlbCPd6ymiZvgUS4lQ1cAMI1B7BMIbo?= =?us-ascii?Q?ypeQv4ySry7VhGofFTls1XN8D1riwCsX2Przncy/A6E/PKfATBNy893lp+MK?= =?us-ascii?Q?ZSYfUIa6kdHjJeetkOGaJORtFCRFlZN6U8v+d8NNmfwiQqGaITT4Vh4YrLoB?= =?us-ascii?Q?Eta4woBatVnecAZ/Bdt0O+Z7w7OEZ2RoFae4Ms6GRzj2l91apXGF7Y2SRamG?= =?us-ascii?Q?0b8ol8dcrhhVBFe8kIhuL/zegL+QZpkRdYW9AMRupOz/zVOK5sexBFlS5hoa?= =?us-ascii?Q?sKQHMgyWtyMyLIn8D6po6WReC3MeLgcrjzxzSM62cpXrlcVetUVrlJclc+7q?= =?us-ascii?Q?L6xVg4ENnqbPU5sPcVM79yKQ/IWO5ir4ZUcqbmNkor9uIdKg6HzNPsgjKzD/?= =?us-ascii?Q?9QGiFgrFwHcyyB9OpWE=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: IA1PR12MB6068.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 733fb50b-c4fc-46f7-e70e-08dbce4b171d X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2023 13:23:30.8247 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: gA7ykVlxHLcU55YWksIKVoyplXa/sI5lOfwvAHu9TxUIenR2cZai/AEcoS8mN7vIVDv1NvVTHYoaDFe+T0uaYQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8575 Precedence: Bulk 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,brit.chesley@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: A2SqvrRmzEQThO3DiTY0rxRKx7686176AA= Content-Language: en-US Content-Type: multipart/mixed; boundary="_004_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=dnr5PjHr; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io --_004_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_ Content-Type: multipart/alternative; boundary="_000_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_" --_000_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable [Public] Hello Hao, Ashish, Rick, I recently uploaded a patch to fix the same assert (BZ 4456), but it is sti= ll under review although I haven't heard anything since August. Please look= at my corresponding patch which I have attached as an outlook item, and we= can discuss which patch should be merged to fix the issue. Thanks, Brit Chesley From: devel@edk2.groups.io On Behalf Of Wu, Hao A vi= a groups.io Sent: Sunday, October 15, 2023 8:54 PM To: Ashish Singhal ; Rick Tseng ; devel@edk2.groups.io; Ni, Ray ; Wang, Jian J ; Gao, Liming Cc: Jeff Brasen Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/config de= scriptor after port reset Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. Please grant me some time to review this patch. Really sorry that I am not able to provide an estimated time for the review= . Best Regards, Hao Wu From: Ashish Singhal > Sent: Friday, October 13, 2023 10:13 AM To: Rick Tseng >; devel@edk2.gr= oups.io; Wu, Hao A >; Ni, Ray >; = Wang, Jian J >; Gao, Li= ming > Cc: Jeff Brasen > Subject: Re: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor afte= r port reset Hello Hao/Ray/Jian/Gao, Any feedback on this patch? Thanks Ashish ________________________________ From: Rick Tseng > Sent: Sunday, September 24, 2023 7:54 PM To: devel@edk2.groups.io > Cc: hao.a.wu@intel.com >; ray.ni@intel.com >; jian.j.wang@intel.com >; gaolimi= ng@byosoft.com.cn >; Ashish Singhal >; Jeff Brasen >; Rick Tseng > Subject: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor after po= rt reset To fix the assert due to ASSERT(TrsRing !=3DNULL) in XhcSyncTrsRing. There is a recovery in usb mass stroage driver to do port reset after fail in transfer. And port reset operation makes that all memory resources(descriptors, endpoint memory) belonging to this device are reclaimed in underlying Xhci driver. Because USB descriptors are reclaimed in underlying Xhci driver, the next "set config" would not trigger the "Configuration Endpoint" command in Xhci driver as there is no existing configuation descriptor. It would prevent from allocating memory from xhci for endpoints. Thus there is no memmory allocated for transfering on non-default endpoint, it makes the assert happens when usb mass stroage tries to transfer after reset. This change is to refetch the device and config descriptor after port reset, it would rebuild device and configuration descriptor in Xhci driver. So the "set config" command would trigger the "Configuration Endpoint" in xhci and allocate memory for endpoints. Signed-off-by: Rick Tseng > --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 77 ++++++++++++++++++++++-- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | 25 ++++++++ 2 files changed, 96 insertions(+), 6 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb= /UsbBusDxe/UsbBus.c index c25f3cc2f2..f6e1f88b3d 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c @@ -815,12 +815,16 @@ UsbIoPortReset ( IN EFI_USB_IO_PROTOCOL *This ) { - USB_INTERFACE *UsbIf; - USB_INTERFACE *HubIf; - USB_DEVICE *Dev; - EFI_TPL OldTpl; - EFI_STATUS Status; - UINT8 DevAddress; + USB_INTERFACE *UsbIf; + USB_INTERFACE *HubIf; + USB_DEVICE *Dev; + EFI_TPL OldTpl; + EFI_STATUS Status; + UINT8 DevAddress; + USB_DEVICE_DESC DevDesc; + UINT8 NumConfig; + VOID *Buf; + UINT8 Index; OldTpl =3D gBS->RaiseTPL (USB_BUS_TPL); @@ -882,6 +886,67 @@ UsbIoPortReset ( // is in CONFIGURED state. // if (Dev->ActiveConfig !=3D NULL) { + // + // We just do a port reset, so we need to do as a new device enumerati= on. + // Need to get the device descriptor, configuration descriptor before = set config + // + Status =3D UsbCtrlGetDesc (Dev, USB_DESC_TYPE_DEVICE, 0, 0, &DevDesc, = sizeof (DevDesc)); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "UsbIoPortReset: failed to get device desc for device %d - %r\n", + Dev->Address, + Status + )); + goto ON_EXIT; + } + + NumConfig =3D Dev->DevDesc->Desc.NumConfigurations; + if (NumConfig =3D=3D 0) { + DEBUG (( + DEBUG_ERROR, + "UsbIoPortReset: no configuration descriptor for device %d - %r\n"= , + Dev->Address, + Status + )); + goto ON_EXIT; + } + + for (Index =3D 0; Index < NumConfig; Index++) { + if (Dev->DevDesc->Configs[Index] =3D=3D NULL) { + DEBUG (( + DEBUG_ERROR, + "UsbIoPortReset: no configuration descriptor for index %d - %r\n= ", + Index, + Status + )); + goto ON_EXIT; + } + + Buf =3D AllocateZeroPool (Dev->DevDesc->Configs[Index]->Desc.TotalLe= ngth); + if (Buf =3D=3D NULL) { + DEBUG (( + DEBUG_ERROR, + "UsbIoPortReset: allocation memory fail for configuration desc -= %r\n", + Status + )); + goto ON_EXIT; + } + + Status =3D UsbCtrlGetDesc (Dev, USB_DESC_TYPE_CONFIG, Index, 0, Buf,= Dev->DevDesc->Configs[Index]->Desc.TotalLength); + FreePool (Buf); + + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "UsbIoPortReset: failed to get config desc for device %d - %r\n"= , + Dev->Address, + Status + )); + goto ON_EXIT; + } + } + Status =3D UsbSetConfig (Dev, Dev->ActiveConfig->Desc.ConfigurationVal= ue); if (EFI_ERROR (Status)) { diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h b/MdeModulePkg/Bus/Us= b/UsbBusDxe/UsbDesc.h index ce205e706d..5ae5c4056b 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h @@ -224,4 +224,29 @@ UsbIoClearFeature ( IN UINT16 Index ); +/** + Get the standard descriptors. + + @param UsbDev The USB device to read descriptor from. + @param DescType The type of descriptor to read. + @param DescIndex The index of descriptor to read. + @param LangId Language ID, only used to get string, othe= rwise set + it to 0. + @param Buf The buffer to hold the descriptor read. + @param Length The length of the buffer. + + @retval EFI_SUCCESS The descriptor is read OK. + @retval Others Failed to retrieve the descriptor. + +**/ +EFI_STATUS +UsbCtrlGetDesc ( + IN USB_DEVICE *UsbDev, + IN UINTN DescType, + IN UINTN DescIndex, + IN UINT16 LangId, + OUT VOID *Buf, + IN UINTN Length + ); + #endif -- 2.17.1 -=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 (#109644): https://edk2.groups.io/g/devel/message/109644 Mute This Topic: https://groups.io/mt/101576341/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_000_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

[Public]


Hello Hao, Ashish, Rick,

 

I recently uploaded a patch to fix the same assert (= BZ 4456), but it is still under review although I haven’t heard anyth= ing since August. Please look at my corresponding patch which I have attach= ed as an outlook item, and we can discuss which patch should be merged to fix the issue.

 

Thanks,

 

Brit Chesley

 

From: devel@edk2.groups.io <devel@edk2.gro= ups.io> On Behalf Of Wu, Hao A via groups.io
Sent: Sunday, October 15, 2023 8:54 PM
To: Ashish Singhal <ashishsingha@nvidia.com>; Rick Tseng <r= tseng@nvidia.com>; devel@edk2.groups.io; Ni, Ray <ray.ni@intel.com>= ;; Wang, Jian J <jian.j.wang@intel.com>; Gao, Liming <gaoliming@by= osoft.com.cn>
Cc: Jeff Brasen <jbrasen@nvidia.com>
Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/UsbBus: Get device/co= nfig descriptor after port reset

 

Caution: This message originated from an External Source. Use proper caution= when opening attachments, clicking links, or responding.

 

Please grant me some time to review this patch.=

Really sorry that I am not able to provide an estima= ted time for the review.

 

Best Regards,

Hao Wu

 

From: Ashish Singhal <ashishsingha@nvidia.com>
Sent: Friday, October 13, 2023 10:13 AM
To: Rick Tseng <rtseng@nvidi= a.com>; devel@edk2.groups.io; Wu, Hao A= <hao.a.wu@intel.com>; Ni, = Ray <ray.ni@intel.com>; Wang,= Jian J <jian.j.wang@intel.com<= /a>>; Gao, Liming <gaoliming@byos= oft.com.cn>
Cc: Jeff Brasen <jbrasen@nv= idia.com>
Subject: Re: [PATCH] MdeModulePkg/UsbBus: Get device/config descript= or after port reset

 

Hello Hao/Ray/Jian/Gao,

 

Any feedback on this patch?

 

Thanks

Ashish


From: Rick Tseng <rtseng@nvidia.com>
Sent: Sunday, September 24, 2023 7:54 PM
To: devel@edk2.groups.io= <devel@edk2.groups.io> Cc: hao.a.wu@intel.com <= ;hao.a.wu@intel.com>; ray.ni@intel.com <ray.ni@intel.com>; jian.j.wang@intel.com <jian.j.wang@intel.com>; gaoliming@byosoft.com.cn &l= t;gaoliming@byosoft.com.cn&= gt;; Ashish Singhal <ashishsi= ngha@nvidia.com>; Jeff Brasen <jbrasen@nvidia.com>; Rick Tseng <rtseng@nvidia.com&= gt;
Subject: [PATCH] MdeModulePkg/UsbBus: Get device/config descriptor a= fter port reset

 

To fix the assert due= to ASSERT(TrsRing !=3DNULL) in XhcSyncTrsRing.

There is a recovery in usb mass stroage driver to do port reset after
fail in transfer. And port reset operation makes that all memory
resources(descriptors, endpoint memory) belonging to this device are
reclaimed in underlying Xhci driver.

Because USB descriptors are reclaimed in underlying Xhci driver, the
next "set config" would not trigger the "Configuration Endpo= int"
command in Xhci driver as there is no existing configuation
descriptor. It would prevent from allocating memory from xhci for
endpoints.

Thus there is no memmory allocated for transfering on non-default
endpoint, it makes the assert happens when usb mass stroage tries
to transfer after reset.

This change is to refetch the device and config descriptor after
port reset, it would rebuild device and configuration descriptor in
Xhci driver. So the "set config" command would trigger the
"Configuration Endpoint" in xhci and allocate memory for endpoint= s.

Signed-off-by: Rick Tseng <rtseng@n= vidia.com>
---
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c  | 77 ++++++++++++++++++= ++++--
 MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h | 25 ++++++++
 2 files changed, 96 insertions(+), 6 deletions(-)

diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c b/MdeModulePkg/Bus/Usb= /UsbBusDxe/UsbBus.c
index c25f3cc2f2..f6e1f88b3d 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c
@@ -815,12 +815,16 @@ UsbIoPortReset (
   IN EFI_USB_IO_PROTOCOL  *This
   )
 {
-  USB_INTERFACE  *UsbIf;
-  USB_INTERFACE  *HubIf;
-  USB_DEVICE     *Dev;
-  EFI_TPL        OldTpl;
-  EFI_STATUS     Status;
-  UINT8          DevAddr= ess;
+  USB_INTERFACE    *UsbIf;
+  USB_INTERFACE    *HubIf;
+  USB_DEVICE       *Dev;
+  EFI_TPL          OldTp= l;
+  EFI_STATUS       Status;
+  UINT8          &n= bsp; DevAddress;
+  USB_DEVICE_DESC  DevDesc;
+  UINT8          &n= bsp; NumConfig;
+  VOID          &nb= sp;  *Buf;
+  UINT8          &n= bsp; Index;
 
   OldTpl =3D gBS->RaiseTPL (USB_BUS_TPL);
 
@@ -882,6 +886,67 @@ UsbIoPortReset (
   // is in CONFIGURED state.
   //
   if (Dev->ActiveConfig !=3D NULL) {
+    //
+    // We just do a port reset, so we need to do as a new d= evice enumeration.
+    // Need to get the device descriptor, configuration des= criptor before set config
+    //
+    Status =3D UsbCtrlGetDesc (Dev, USB_DESC_TYPE_DEVICE, 0= , 0, &DevDesc, sizeof (DevDesc));
+    if (EFI_ERROR (Status)) {
+      DEBUG ((
+        DEBUG_ERROR,
+        "UsbIoPortReset: failed to= get device desc for device %d - %r\n",
+        Dev->Address,
+        Status
+        ));
+      goto ON_EXIT;
+    }
+
+    NumConfig =3D Dev->DevDesc->Desc.NumConfiguration= s;
+    if (NumConfig =3D=3D 0) {
+      DEBUG ((
+        DEBUG_ERROR,
+        "UsbIoPortReset: no config= uration descriptor for device %d - %r\n",
+        Dev->Address,
+        Status
+        ));
+      goto ON_EXIT;
+    }
+
+    for (Index =3D 0; Index < NumConfig; Index++) {
+      if (Dev->DevDesc->Configs[Index] =3D= =3D NULL) {
+        DEBUG ((
+          DEBUG_ERROR,
+          "UsbIoPortRese= t: no configuration descriptor for index %d - %r\n",
+          Index,
+          Status
+          ));
+        goto ON_EXIT;
+      }
+
+      Buf =3D AllocateZeroPool (Dev->DevDesc-&= gt;Configs[Index]->Desc.TotalLength);
+      if (Buf =3D=3D NULL) {
+        DEBUG ((
+          DEBUG_ERROR,
+          "UsbIoPortRese= t: allocation memory fail for configuration desc - %r\n",
+          Status
+          ));
+        goto ON_EXIT;
+      }
+
+      Status =3D UsbCtrlGetDesc (Dev, USB_DESC_TY= PE_CONFIG, Index, 0, Buf, Dev->DevDesc->Configs[Index]->Desc.Total= Length);
+      FreePool (Buf);
+
+      if (EFI_ERROR (Status)) {
+        DEBUG ((
+          DEBUG_ERROR,
+          "UsbIoPortRese= t: failed to get config desc for device %d - %r\n",
+          Dev->Address, +          Status
+          ));
+        goto ON_EXIT;
+      }
+    }
+
     Status =3D UsbSetConfig (Dev, Dev->ActiveConfig= ->Desc.ConfigurationValue);
 
     if (EFI_ERROR (Status)) {
diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h b/MdeModulePkg/Bus/Us= b/UsbBusDxe/UsbDesc.h
index ce205e706d..5ae5c4056b 100644
--- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h
+++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbDesc.h
@@ -224,4 +224,29 @@ UsbIoClearFeature (
   IN  UINT16        = ;       Index
   );
 
+/**
+  Get the standard descriptors.
+
+  @param  UsbDev        =         The USB device to read descripto= r from.
+  @param  DescType       &nbs= p;      The type of descriptor to read.
+  @param  DescIndex       &nb= sp;     The index of descriptor to read.
+  @param  LangId        =         Language ID, only used to get st= ring, otherwise set
+            &n= bsp;            = ;       it to 0.
+  @param  Buf        &nb= sp;          The buffer to hol= d the descriptor read.
+  @param  Length        =         The length of the buffer.
+
+  @retval EFI_SUCCESS        =    The descriptor is read OK.
+  @retval Others         = ;       Failed to retrieve the descriptor. +
+**/
+EFI_STATUS
+UsbCtrlGetDesc (
+  IN  USB_DEVICE  *UsbDev,
+  IN  UINTN       DescType,
+  IN  UINTN       DescIndex,
+  IN  UINT16      LangId,
+  OUT VOID        *Buf,
+  IN  UINTN       Length
+  );
+
 #endif
--
2.17.1

_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#109644) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--_000_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_-- --_004_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_ Content-Type: message/rfc822 Content-Disposition: attachment; creation-date="Mon, 16 Oct 2023 13:23:29 GMT"; modification-date="Mon, 16 Oct 2023 13:23:30 GMT" Received: from CY5PR12MB6550.namprd12.prod.outlook.com (2603:10b6:930:42::6) by IA1PR12MB6068.namprd12.prod.outlook.com with HTTPS; Wed, 16 Aug 2023 16:49:43 +0000 Received: from SA1P222CA0038.NAMP222.PROD.OUTLOOK.COM (2603:10b6:806:2d0::19) by CY5PR12MB6550.namprd12.prod.outlook.com (2603:10b6:930:42::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6678.29; Wed, 16 Aug 2023 16:49:36 +0000 Received: from SA2PEPF00001505.namprd04.prod.outlook.com (2603:10b6:806:2d0:cafe::5f) by SA1P222CA0038.outlook.office365.com (2603:10b6:806:2d0::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6652.33 via Frontend Transport; Wed, 16 Aug 2023 16:49:36 +0000 Received: from mail02.groups.io (66.175.222.108) by SA2PEPF00001505.mail.protection.outlook.com (10.167.242.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6699.15 via Frontend Transport; Wed, 16 Aug 2023 16:49:36 +0000 From: "Chesley, Brit via groups.io" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Gao, Liming" , "Ni, Ray" , "Chang, Abner" Subject: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: UsbBusDxe: Rebuild Descriptor Table Thread-Topic: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: UsbBusDxe: Rebuild Descriptor Table Thread-Index: AQHZsPWQ4t+8Y8P3zEmG6icey3EW8q/TnlCggBm/PqA= Sender: "devel@edk2.groups.io" Date: Wed, 16 Aug 2023 16:49:26 +0000 Message-ID: <177BEB17BB6F2D4E.12117@groups.io> References: <20230707170709.45-1-brit.chesley@amd.com> List-Help: List-Subscribe: List-Unsubscribe: In-Reply-To: Reply-To: "devel@edk2.groups.io" , "Chesley, Brit" Accept-Language: en-US Content-Language: en-US X-MS-Exchange-Organization-AuthSource: SA2PEPF00001505.namprd04.prod.outlook.com X-MS-Has-Attach: X-Auto-Response-Suppress: All X-MS-Exchange-Organization-Network-Message-Id: 5f198f4d-4e66-48a1-2858-08db9e78c64a X-MS-Exchange-Organization-SCL: 1 X-Message-Flag: Follow up X-MS-TNEF-Correlator: X-MS-Exchange-Organization-RecordReviewCfmType: 0 msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=72a4cd6c-c552-4011-a674-c46b050e2c9d;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2023-08-16T16:35:59Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; received-spf: Pass (protection.outlook.com: domain of groups.io designates 66.175.222.108 as permitted sender) receiver=protection.outlook.com; client-ip=66.175.222.108; helo=mail02.groups.io; pr=C x-ms-exchange-organization-originalclientipaddress: 66.175.222.108 x-ms-exchange-organization-originalserveripaddress: 10.167.242.37 x-ms-publictraffictype: Email X-Microsoft-Antispam-Mailbox-Delivery: ucf:0;jmr:0;auth:0;dest:I;ENG:(910001)(944506478)(944626604)(920097)(930097)(140003); X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?XaCHG5Lj/CZP/cWi/ERQj/DQdbEDZobXNNC4vxr4WoENqByfgI3SwnSYl4vb?= =?us-ascii?Q?Se1zM7w98S3G9eUW3dEgNBXItQWLzD1s51qMhQ8LP3H4tWwqTI9hwlqLLNZ7?= =?us-ascii?Q?ZNqFzhhl2KnjcgoVIFUMKbWz7dmaxze2RcnA954ZmRljaBLVlfrbDjHWP2X0?= =?us-ascii?Q?mhMLmr6GHXDUk5iEmoA21s8l8OyDoi5iYDvbTlmpugg4C0ySZd9AbBQim47Q?= =?us-ascii?Q?JTl6Mi3tXnbpT7DbTcebPRA30Kz81ht9JsyPKdDRHaFy6KBB5lQalYybn/Qk?= =?us-ascii?Q?WhPaTXUv88NWjjKsCuFUznEBJeIpH3MBSFrjokKjKaE7nb7oEyRjqclPhQgX?= =?us-ascii?Q?sE5LmN00PhJo056NDxdSRgvXXz/qb9A9soAZl9tA2LCXGclIlDyf3Npg6L88?= =?us-ascii?Q?dPBOmP+EJrkAALzh5l+XzUoca+PKC78JvLbcLGBDJnVhLXHXiyXVBL1g5ET2?= =?us-ascii?Q?6rqsgVbfSrMtB9h9gjY0ko4oRKVKS/TEDnS1GM5aQXUYrU3fRUopQt04rcFo?= =?us-ascii?Q?sJecFWUbrwZS2AGHG1TtM0MJ3d9IH7RDtds0b3CWBgqto81shjDxB1T9YSks?= =?us-ascii?Q?/MhvA05LiCCJ54p8sXRLSvQM2NaBNMwSP/b09CJI+2cDxH9ax17pF9YS+kMl?= =?us-ascii?Q?mpb2hm42kR/aK2iHz5yRoUW4+IggXtLVSQ5PISASc8wESxNY5IERvNejhOnT?= =?us-ascii?Q?VWSEv5aSgUDYt710jebP4rYyRGVxhZGr8i6aAJXJpJlEPiv0L5lhrkoQ4oWV?= =?us-ascii?Q?8ag3CfPCJpnMIS4hzzfaVysIx5ulSdRUpvtxUZSurGm5my6XxARE7QYBLB0v?= =?us-ascii?Q?3pqlEhIhzd1lXWvCfqUIUIykk0hsumOsNqX1lckASDTR4CZ9mggi/Ud42gx2?= =?us-ascii?Q?Icpny939cr5SaG5GPF4wX9cccXAdNPJXPBoXY+rMRQcCEaTLhDR01wECBPvc?= =?us-ascii?Q?7WvRq0MdXXLj1sfTJ3Q6IkLXZiXzz4Eb1yfrjBUJv8OR3iFEo0/xCrwRff1y?= =?us-ascii?Q?FxFsxyzUFbjg1LV15pS5TQk42hgWuYlT/hniFpEnQddfvh1H5132udN/LLke?= =?us-ascii?Q?BUGxn03kbtaJMqq47Q5s40IiHmNWndNDvkEmNX59/dGdq2p5hmqmp9R+yZJt?= =?us-ascii?Q?kUbUM2eykBJtwWe0D6JaBZZqFbyfvpJnK+luAvjx6e+n78+aK0Fj7kmtughs?= =?us-ascii?Q?fVDIn6oUI0eqtxVn5qrI0mI3n9IobpKZ1qLeaWBZRBnwlCuif8oIuA+su1/T?= =?us-ascii?Q?uADjtrR9yuyOTwd25xIP6FM1tCvMMtkilo6Nt3ZEvEOH7oq2FZRlIQh31iP4?= =?us-ascii?Q?PHFmDg9hWBPZmNYWoj+DqAPI3d06tJkHfa9MIiK9BAyXySP9HIYioCPbjzM+?= =?us-ascii?Q?DTmIqE/UKZIhBFcSAtf++LLl9u34775ZmKaG/yOaVbZl7MQUSZSMwVXWzoJ3?= =?us-ascii?Q?hfDD4xw47kl3CSt6e5TIktgPkDdKBLQNRXsulnuuZwoDKjN/V49gx7oew1sZ?= =?us-ascii?Q?SL3Vk5mqALOtdUHYh0x5YDx3ZlqSwqgPTJPbwMta/uSpt84FTtyeBvzxQfPo?= =?us-ascii?Q?+pr4d1T14suiFF6727ZdhnwXRDudoNETUHT6MAFnhONu8PcovfJVRhDVBXAd?= =?us-ascii?Q?dkF27ic0fBcdOXL4mo/tmwj8L3iRILB8NHLhOWufDcjJXqbO9vp9/hg15obD?= =?us-ascii?Q?61e+O1sJYUerVEFD7+kcNdRT0DRJEpTzfzg7QnOtz0dzQ+g9dWm+OBOFss0K?= =?us-ascii?Q?tXIAsuB0aRP90hURFrZLRIStTSEh9AKM6a/vbjFzaUBxwHewjWky?= Content-Type: text/plain; charset="us-ascii" Content-ID: <2DD387052BDA5842B8D093EB09CB8BF4@namprd12.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 [AMD Official Use Only - General] Caution: This message originated from an External Source. Use proper cautio= n when opening attachments, clicking links, or responding. [AMD Official Use Only - General] Hello Hao, Its no problem. I agree that the endpoint transfer rings should be allocate= d after the UsbSetConfig command, but this is not the case. In XhcControlTr= ansfer, after the if statement checking for USB_REQ_SET_CONFIG, the for-loo= p loops through all of DevDesc.NumConfigurations and calls XhcSetConfigCmd.= The issue here is that after a reset is issued XhcInitializeDeviceSlot64 i= s called which frees Xhc->UsbDevContext[SlotId]. This sets Xhc->UsbDevConte= xt[SlotId].DevDesc.NumConfigurations to 0. So XhcSetConfigCmd is never call= ed, and the other endpoint transfer rings besides the default are never rei= nitialized. From what I could tell the easiest way to reacquire the proper = NumConfigurations value was to call UsbBuildDescTable for the device. Best, Brit Chesley > -----Original Message----- > From: Wu, Hao A > Sent: Monday, July 31, 2023 2:37 AM > To: devel@edk2.groups.io; Chesley, Brit > Cc: Wang, Jian J ; Gao, Liming > ; Ni, Ray ; Chang, Abner > > Subject: RE: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: UsbBusDxe: Rebuild > Descriptor Table > > Caution: This message originated from an External Source. Use proper > caution when opening attachments, clicking links, or responding. > > > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of > > brit.chesley via groups.io > > Sent: Saturday, July 8, 2023 1:07 AM > > To: devel@edk2.groups.io > > Cc: Wang, Jian J ; Gao, Liming > > ; Wu, Hao A ; Ni, Ray > > ; Abner Chang > > Subject: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: UsbBusDxe: Rebuild > > Descriptor Table > > > > From: Britton Chesley > > > > Fixed a bug which led to an ASSERT due to the USB device context being > > maintained after a port reset, but the underlying XHCI context was > > uninitialized. Specifically, Xhc->UsbDevContext is freed after a reset > > and only re-allocates the default [0] enpoint transfer ring. Added > > build > > > Really sorry for another question. > > My take is that the transfer ring of other endpoints (besides the Default > Control Endpoint) will be re-initialized by the below flow: > UsbSetConfig -> UsbCtrlRequest (USB_REQ_SET_CONFIG) -> > XhcSetConfigCmd(64) -> XhcInitializeEndpointContext(64) > > Could you help to elaborate a bit more on what is the issue with the abov= e > (current) flow and why rebuilding the Descriptor Table before UsbSetConfi= g > can resolve it? > > Thanks in advance. > > Best Regards, > Hao Wu > > > > descriptor table call in UsbIoPortReset. BZ 4456 > > > > Cc: Jian J Wang > > Cc: Liming Gao > > Cc: Hao A Wu > > Cc: Ray Ni > > Cc: Abner Chang > > Signed-off-by: Britton Chesley > > --- > > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 26 > > ++++++++++++++++++++++++- > > 1 file changed, 25 insertions(+), 1 deletion(-) > > > > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > > index c25f3cc2f279..a5b798bd8d6c 100644 > > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > > @@ -821,6 +821,7 @@ UsbIoPortReset ( > > EFI_TPL OldTpl; > > EFI_STATUS Status; > > UINT8 DevAddress; > > + UINT8 Config; > > > > OldTpl =3D gBS->RaiseTPL (USB_BUS_TPL); > > > > @@ -882,8 +883,26 @@ UsbIoPortReset ( > > // is in CONFIGURED state. > > // > > if (Dev->ActiveConfig !=3D NULL) { > > - Status =3D UsbSetConfig (Dev, Dev->ActiveConfig- > >Desc.ConfigurationValue); > > + UsbFreeDevDesc (Dev->DevDesc); > > > > + Status =3D UsbRemoveConfig (Dev); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: Failed to remove > > configuration - %r\n", Status)); > > + } > > + > > + Status =3D UsbGetMaxPacketSize0 (Dev); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: Failed to get max packet > > + size - > > %r\n", Status)); > > + } > > + > > + Status =3D UsbBuildDescTable (Dev); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: Failed to build > > + descriptor > > table - %r\n", Status)); > > + } > > + > > + Config =3D Dev->DevDesc->Configs[0]->Desc.ConfigurationValue; > > + > > + Status =3D UsbSetConfig (Dev, Config); > > if (EFI_ERROR (Status)) { > > DEBUG (( > > DEBUG_ERROR, > > @@ -892,6 +911,11 @@ UsbIoPortReset ( > > Status > > )); > > } > > + > > + Status =3D UsbSelectConfig (Dev, Config); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: Failed to set > > + configuration - > > %r\n", Status)); > > + } > > } > > > > ON_EXIT: > > -- > > 2.36.1 > > > > > > > > > > -=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 (#107798): https://edk2.groups.io/g/devel/message/107798 Mute This Topic: https://groups.io/mt/100010162/7581415 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [brit.chesley@amd.com] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --_004_IA1PR12MB6068FE757D3FAFAB90DF194A93D7AIA1PR12MB6068namp_--