public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [edk2-devel] empty USB DVD disk hang Xhci
@ 2023-07-18  1:48 苏丽坤
  2023-07-25  1:44 ` 回复: " gaoliming via groups.io
  0 siblings, 1 reply; 8+ messages in thread
From: 苏丽坤 @ 2023-07-18  1:48 UTC (permalink / raw)
  To: gaoliming, miki.demeter, devel


[-- Attachment #1.1.1: Type: text/plain, Size: 1634 bytes --]

Hi

    We find a bug in xhci, USB DVD boot with emtpy disk will hang Xhci while Ehci can pass.

    The hang log is shown as : MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c(1847): TrsRing != ((void *) 0)

    We suggest a way to solve this bug is shown as: https://github.com/suling-123/edk2 the latest commit,   MdeModulePkg: Solve boot hang xhci driver when use USB DVD with empty disk, 950bc8781d81b96b0c7944e7ac947382b1bc0c06






本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
This email and its attachments contain confidential information from Loongson Technology , which is intended only for the person or entity whose address is listed above. Any use of the information contained herein in any way (including, but not limited to, total or partial disclosure, reproduction or dissemination) by persons other than the intended recipient(s) is prohibited. If you receive this email in error, please notify the sender by phone or email immediately and delete it. 

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106984): https://edk2.groups.io/g/devel/message/106984
Mute This Topic: https://groups.io/mt/100212046/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



[-- Attachment #1.1.2: Type: text/html, Size: 4338 bytes --]

[-- Attachment #1.2: image.png --]
[-- Type: image/png, Size: 63621 bytes --]

[-- Attachment #2: 0001-MdeModulePkg-Solve-boot-hang-xhci-driver-when-use-US.patch --]
[-- Type: application/octet-stream, Size: 1358 bytes --]

From 950bc8781d81b96b0c7944e7ac947382b1bc0c06 Mon Sep 17 00:00:00 2001
From: likun su <sulikun@loongson.cn>
Date: Wed, 5 Jul 2023 19:44:13 +0800
Subject: [PATCH] MdeModulePkg: Solve boot hang xhci driver when use USB DVD
 with empty disk

Signed-off-by: likun su <sulikun@loongson.cn>
---
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 298fb88b81..6f3d3d1b8a 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -171,7 +171,6 @@ XhcCreateUrb (
   Urb->Context  = Context;
 
   Status = XhcCreateTransferTrb (Xhc, Urb);
-  ASSERT_EFI_ERROR (Status);
   if (EFI_ERROR (Status)) {
     DEBUG ((DEBUG_ERROR, "XhcCreateUrb: XhcCreateTransferTrb Failed, Status = %r\n", Status));
     FreePool (Urb);
@@ -248,6 +247,9 @@ XhcCreateTransferTrb (
   Dci = XhcEndpointToDci (Urb->Ep.EpAddr, (UINT8)(Urb->Ep.Direction));
   ASSERT (Dci < 32);
   EPRing        = (TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];
+  if (EPRing == NULL) {
+    return EFI_OUT_OF_RESOURCES; 
+  }
   Urb->Ring     = EPRing;
   OutputContext = Xhc->UsbDevContext[SlotId].OutputContext;
   if (Xhc->HcCParams.Data.Csz == 0) {
-- 
2.20.1


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

end of thread, other threads:[~2023-08-03 11:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-18  1:48 [edk2-devel] empty USB DVD disk hang Xhci 苏丽坤
2023-07-25  1:44 ` 回复: " gaoliming via groups.io
2023-07-25  2:18   ` Wu, Hao A
2023-07-27  3:21     ` 苏丽坤
2023-07-27  7:23       ` Chao Li
2023-08-02  5:29         ` 回复: " gaoliming via groups.io
2023-08-03  2:44           ` Chao Li
2023-08-03 11:43             ` 苏丽坤

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