public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table after resetting port
@ 2023-05-16 22:15 brit.chesley
  2023-06-06  3:14 ` Wu, Hao A
  0 siblings, 1 reply; 3+ messages in thread
From: brit.chesley @ 2023-05-16 22:15 UTC (permalink / raw)
  To: devel; +Cc: Jian J Wang, Liming Gao, Hao A Wu, Ray Ni

From: Britton Chesley <Brit.Chesley@amd.com>

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

Cc: Jian J Wang <jian.j.wang@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Signed-off-by: Britton Chesley <Brit.Chesley@amd.com>
---
 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);
+
+    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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-28 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 22:15 [PATCH v1 1/1] MdeModulePkg: UsbBusDxe: Build Descriptor table after resetting port brit.chesley
2023-06-06  3:14 ` Wu, Hao A
2023-06-28 23:38   ` [edk2-devel] " Mike Maslenkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox