From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smarthost01b.sbp.mail.zen.net.uk (smarthost01b.sbp.mail.zen.net.uk [212.23.1.3]) by mx.groups.io with SMTP id smtpd.web11.11850.1663679664152905025 for ; Tue, 20 Sep 2022 06:14:24 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=permerror, err=parse error for token &{10 18 sdn.klaviyomail.com}: permanent DNS error (domain: starlabs.systems, ip: 212.23.1.3, mailfrom: sean@starlabs.systems) Received: from [51.148.147.4] (helo=starbook.lan) by smarthost01b.sbp.mail.zen.net.uk with esmtp (Exim 4.90_1) (envelope-from ) id 1oad4w-0001Qn-AX; Tue, 20 Sep 2022 13:14:22 +0000 From: "Sean Rhodes" To: devel@edk2.groups.io Cc: Sean Rhodes , Hao A Wu , Ray Ni Subject: [PATCH 2/2] MdeModulePkg/UsbBusDxe: Reset the device on error Date: Tue, 20 Sep 2022 14:14:13 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-Originating-smarthost01b-IP: [51.148.147.4] Feedback-ID: 51.148.147.4 Content-Transfer-Encoding: quoted-printable Try a port reset if GetPortStatus returns and error. Cc: Hao A Wu Cc: Ray Ni Signed-off-by: Sean Rhodes --- MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c b/MdeModulePkg/Bus/= Usb/UsbBusDxe/UsbEnumer.c index 7fc567898a..13112be2a5 100644 --- a/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c +++ b/MdeModulePkg/Bus/Usb/UsbBusDxe/UsbEnumer.c @@ -992,7 +992,9 @@ UsbEnumeratePort ( // Now, new device connected, enumerate and configure the device=0D //=0D DEBUG ((DEBUG_INFO, "UsbEnumeratePort: new device connected at port %d= \n", Port));=0D - if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)= ) {=0D + if (USB_BIT_IS_SET (PortState.PortChangeStatus, USB_PORT_STAT_C_RESET)= &&=0D + (Status !=3D EFI_DEVICE_ERROR))=0D + {=0D Status =3D UsbEnumerateNewDev (HubIf, Port, FALSE);=0D } else {=0D Status =3D UsbEnumerateNewDev (HubIf, Port, TRUE);=0D --=20 2.34.1