Sorry for the late response, inline comments below:
> -----Original Message----- > From: [email protected] <[email protected]> > Sent: Wednesday, May 17, 2023 6:16 AM > To: [email protected] > Cc: Wang, Jian J <[email protected]>; Gao, Liming > <[email protected]>; Wu, Hao A <[email protected]>; Ni, Ray > <[email protected]> > Subject: [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table > after resetting port > > From: Britton Chesley <[email protected]> > > 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. Added build descriptor table call in UsbIoPortReset Could you help to elaborate on what data in XHCI is not initialized that leads to the assert? Thanks. > > Cc: Jian J Wang <[email protected]> > Cc: Liming Gao <[email protected]> > Cc: Hao A Wu <[email protected]> > Cc: Ray Ni <[email protected]> > Signed-off-by: Britton Chesley <[email protected]> > --- > MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > index c25f3cc2f279..55e0e1f16cdb 100644 > --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBus.c > @@ -882,6 +882,12 @@ UsbIoPortReset ( > // is in CONFIGURED state. > // > if (Dev->ActiveConfig != NULL) { > + Status = UsbBuildDescTable (Dev); The UsbBuildDescTable function will allocate new buffer resources for and under Dev->DevDesc (device, configuration and interface descriptors). Could you help to double check if the old buffers are properly freed for the proposed change? Best Regards, Hao Wu > + > + if (EFI_ERROR (Status)) { > + DEBUG ((DEBUG_ERROR, "UsbIoPortReset: failed to build descriptor > table - %r\n", Status)); > + } > + > Status = UsbSetConfig (Dev, Dev->ActiveConfig- > >Desc.ConfigurationValue); > > if (EFI_ERROR (Status)) { > -- > 2.36.1 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#105754): https://edk2.groups.io/g/devel/message/105754 Mute This Topic: https://groups.io/mt/98948709/21656 Group Owner: [email protected] Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
