[edk2-devel] empty USB DVD disk hang Xhci

苏丽坤 posted 1 patch 9 months, 2 weeks ago
Failed in applying to current master (apply log)
MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
[edk2-devel] empty USB DVD disk hang Xhci
Posted by 苏丽坤 9 months, 2 weeks ago
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/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


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

回复: [edk2-devel] empty USB DVD disk hang Xhci
Posted by gaoliming via groups.io 9 months, 1 week ago
Likun:

 This change is good to me.  Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Hao:

 Have you time to review this fix?

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 苏丽坤
发送时间: 2023年7月18日 9:49
收件人: gaoliming@byosoft.com.cn; miki.demeter@intel.com; devel@edk2.groups.io
主题: [edk2-devel] empty USB DVD disk hang Xhci

 

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. 



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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 (#107212): https://edk2.groups.io/g/devel/message/107212
Mute This Topic: https://groups.io/mt/100342709/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] empty USB DVD disk hang Xhci
Posted by Wu, Hao A 9 months, 1 week ago
Sorry, I do not have much resource to review this in detail. But the patch generally looks good to me:
Acked-by: Hao A Wu hao.a.wu@intel.com<mailto:hao.a.wu@intel.com>

However, I hope the below question can be answered (or add related information to the commit log message) before mering:
Likun, could you help to elaborate a bit more on why the below statement will return NULL pointer for “USB DVD with empty disk”?
EPRing        = (TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];


Best Regards,
Hao Wu

From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Tuesday, July 25, 2023 9:44 AM
To: devel@edk2.groups.io; sulikun@loongson.cn; Demeter, Miki <miki.demeter@intel.com>
Cc: Wu, Hao A <hao.a.wu@intel.com>
Subject: 回复: [edk2-devel] empty USB DVD disk hang Xhci

Likun:
 This change is good to me.  Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>

Hao:
 Have you time to review this fix?

Thanks
Liming
发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 苏丽坤
发送时间: 2023年7月18日 9:49
收件人: gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>; miki.demeter@intel.com<mailto:miki.demeter@intel.com>; devel@edk2.groups.io<mailto:devel@edk2.groups.io>
主题: [edk2-devel] empty USB DVD disk hang Xhci


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

[cid:image001.png@01D9BEE1.61EECFA0]


本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。
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.


本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。
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 (#107215): https://edk2.groups.io/g/devel/message/107215
Mute This Topic: https://groups.io/mt/100343121/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] empty USB DVD disk hang Xhci
Posted by 苏丽坤 9 months, 1 week ago
Hi, Hao,Liming,




   this is my reply, function XhcInitializeDeviceSlot64 will init EndpointTransferRing,while fuctionUsbMassReadBlocks return (Invalid Parameter), which result in run function UsbMassReset, this will call  XhcDisableSlotCmd64, will clear EndpointTransferRing, like this Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL;  If  fuctionUsbMassReadBlocks return success also run function UsbMassReset, will hang for the same reason. why fuctionUsbMassReadBlocks return (Invalid Parameter), this function will call UsbBootRequestSense,this retun (Invalid Parameter). At the same time, Ehci alsoretun  (Invalid Parameter).




Thanks 
-----原始邮件-----
发件人:"Wu, Hao A" <hao.a.wu@intel.com>
发送时间:2023-07-25 10:18:42 (星期二)
收件人: "Gao, Liming" <gaoliming@byosoft.com.cn>, "devel@edk2.groups.io" <devel@edk2.groups.io>, "sulikun@loongson.cn" <sulikun@loongson.cn>, "Demeter, Miki" <miki.demeter@intel.com>
主题: RE: [edk2-devel] empty USB DVD disk hang Xhci



Sorry, I do not have much resource to review this in detail. But the patch generally looks good to me:

Acked-by: Hao A Wu hao.a.wu@intel.com

 

However, I hope the below question can be answered (or add related information to the commit log message) before mering:

Likun, could you help to elaborate a bit more on why the below statement will return NULL pointer for “USB DVD with empty disk”?

EPRing        = (TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];

 

 

Best Regards,

Hao Wu

 

From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Tuesday, July 25, 2023 9:44 AM
To: devel@edk2.groups.io; sulikun@loongson.cn; Demeter, Miki <miki.demeter@intel.com>
Cc: Wu, Hao A <hao.a.wu@intel.com>
Subject:回复: [edk2-devel] empty USB DVD disk hang Xhci

 

Likun:

 This change is good to me.  Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Hao:

 Have you time to review this fix?

 

Thanks

Liming

发件人:devel@edk2.groups.io <devel@edk2.groups.io> 代表 苏丽坤
发送时间: 2023年7月18日 9:49
收件人:gaoliming@byosoft.com.cn; miki.demeter@intel.com; devel@edk2.groups.io
主题: [edk2-devel] empty USB DVD disk hang Xhci

 

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. 



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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 (#107291): https://edk2.groups.io/g/devel/message/107291
Mute This Topic: https://groups.io/mt/100343121/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] empty USB DVD disk hang Xhci
Posted by Chao Li 9 months, 1 week ago
Hi Likun,

Liming and Hao have reviewd and acked your patch, I think you can submit 
your patch on edk2 repo and don't forget include Liming and Hao review 
message. Good job!


Thanks,
Chao
在 2023/7/27 11:21, 苏丽坤 写道:
>
> Hi, Hao,Liming,
>
>
>    this is my reply, function XhcInitializeDeviceSlot64 will init 
> EndpointTransferRing,while fuctionUsbMassReadBlocks return (Invalid 
> Parameter), which result in run function UsbMassReset, this will call  
> XhcDisableSlotCmd64, will clear EndpointTransferRing, like 
> this Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL;  
> If  fuctionUsbMassReadBlocks return success also run function 
> UsbMassReset, will hang for the same reason. why 
> fuctionUsbMassReadBlocks return (Invalid Parameter), this function 
> will call UsbBootRequestSense,this retun (Invalid Parameter). At the 
> same time, Ehcialsoretun (Invalid Parameter).
>
>
> Thanks
>
>     -----原始邮件-----
>     *发件人:* "Wu, Hao A" <hao.a.wu@intel.com>
>     *发送时间:* 2023-07-25 10:18:42 (星期二)
>     *收件人:* "Gao, Liming" <gaoliming@byosoft.com.cn>,
>     "devel@edk2.groups.io" <devel@edk2.groups.io>,
>     "sulikun@loongson.cn" <sulikun@loongson.cn>, "Demeter, Miki"
>     <miki.demeter@intel.com>
>     *主题:* RE: [edk2-devel] empty USB DVD disk hang Xhci
>
>     Sorry, I do not have much resource to review this in detail. But
>     the patch generally looks good to me:
>
>     Acked-by: Hao A Wu hao.a.wu@intel.com
>
>     However, I hope the below question can be answered (or add related
>     information to the commit log message) before mering:
>
>     Likun, could you help to elaborate a bit more on why the below
>     statement will return NULL pointer for “USB DVD with empty disk”?
>
>     EPRing = (TRANSFER_RING
>     *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];
>
>     Best Regards,
>
>     Hao Wu
>
>     *From:*gaoliming <gaoliming@byosoft.com.cn>
>     *Sent:* Tuesday, July 25, 2023 9:44 AM
>     *To:* devel@edk2.groups.io; sulikun@loongson.cn; Demeter, Miki
>     <miki.demeter@intel.com>
>     *Cc:* Wu, Hao A <hao.a.wu@intel.com>
>     *Subject:* 回复: [edk2-devel] empty USB DVD disk hang Xhci
>
>     Likun:
>
>      This change is good to me.  Reviewed-by: Liming Gao
>     <gaoliming@byosoft.com.cn>
>
>     Hao:
>
>      Have you time to review this fix?
>
>     Thanks
>
>     Liming
>
>     *发件人**:*devel@edk2.groups.io <devel@edk2.groups.io> *代表 *苏丽坤
>     *发送时间:* 2023年7月18日 9:49
>     *收件人:* gaoliming@byosoft.com.cn; miki.demeter@intel.com;
>     devel@edk2.groups.io
>     *主题:* [edk2-devel] empty USB DVD disk hang Xhci
>
>     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. /
>
>
>
>     /本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。//
>     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. /
>
>
>
> /本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。
> 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 (#107298): https://edk2.groups.io/g/devel/message/107298
Mute This Topic: https://groups.io/mt/100343121/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


回复: [edk2-devel] empty USB DVD disk hang Xhci
Posted by gaoliming via groups.io 9 months ago
https://github.com/tianocore/edk2/pull/4709 is created to merge this patch. 

 

Thanks

Liming

发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Chao Li
发送时间: 2023年7月27日 15:24
收件人: devel@edk2.groups.io; sulikun@loongson.cn; Wu, Hao A <hao.a.wu@intel.com>
抄送: Gao, Liming <gaoliming@byosoft.com.cn>; Demeter, Miki <miki.demeter@intel.com>
主题: Re: [edk2-devel] empty USB DVD disk hang Xhci

 

Hi Likun,

Liming and Hao have reviewd and acked your patch, I think you can submit your patch on edk2 repo and don't forget include Liming and Hao review message. Good job!

 

Thanks,
Chao

在 2023/7/27 11:21, 苏丽坤 写道:

Hi, Hao,Liming, 

 

   this is my reply, function XhcInitializeDeviceSlot64 will init EndpointTransferRing,while fuctionUsbMassReadBlocks return (Invalid Parameter), which result in run function UsbMassReset, this will call  XhcDisableSlotCmd64, will clear EndpointTransferRing, like this Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL;  If  fuctionUsbMassReadBlocks return success also run function UsbMassReset, will hang for the same reason. why fuctionUsbMassReadBlocks return (Invalid Parameter), this function will call UsbBootRequestSense,this retun (Invalid Parameter). At the same time, Ehci also retun  (Invalid Parameter). 

 

Thanks 



-----原始邮件-----
发件人: "Wu, Hao A"  <mailto:hao.a.wu@intel.com> <hao.a.wu@intel.com>
发送时间: 2023-07-25 10:18:42 (星期二)
收件人: "Gao, Liming"  <mailto:gaoliming@byosoft.com.cn> <gaoliming@byosoft.com.cn>,  <mailto:devel@edk2.groups.io> "devel@edk2.groups.io"  <mailto:devel@edk2.groups.io> <devel@edk2.groups.io>,  <mailto:sulikun@loongson.cn> "sulikun@loongson.cn"  <mailto:sulikun@loongson.cn> <sulikun@loongson.cn>, "Demeter, Miki"  <mailto:miki.demeter@intel.com> <miki.demeter@intel.com>
主题: RE: [edk2-devel] empty USB DVD disk hang Xhci

Sorry, I do not have much resource to review this in detail. But the patch generally looks good to me: 

Acked-by: Hao A Wu hao.a.wu@intel.com <mailto:hao.a.wu@intel.com>  

  

However, I hope the below question can be answered (or add related information to the commit log message) before mering: 

Likun, could you help to elaborate a bit more on why the below statement will return NULL pointer for “USB DVD with empty disk”? 

EPRing        = (TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1]; 

  

  

Best Regards, 

Hao Wu 

  

From: gaoliming  <mailto:gaoliming@byosoft.com.cn> <gaoliming@byosoft.com.cn> 
Sent: Tuesday, July 25, 2023 9:44 AM
To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; sulikun@loongson.cn <mailto:sulikun@loongson.cn> ; Demeter, Miki  <mailto:miki.demeter@intel.com> <miki.demeter@intel.com>
Cc: Wu, Hao A  <mailto:hao.a.wu@intel.com> <hao.a.wu@intel.com>
Subject: 回复: [edk2-devel] empty USB DVD disk hang Xhci 

  

Likun: 

 This change is good to me.  Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > 

  

Hao: 

 Have you time to review this fix? 

  

Thanks 

Liming 

发件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io>  <devel@edk2.groups.io <mailto:devel@edk2.groups.io> > 代表 苏丽坤
发送时间: 2023年7月18日 9:49
收件人: gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> ; miki.demeter@intel.com <mailto:miki.demeter@intel.com> ; devel@edk2.groups.io <mailto:devel@edk2.groups.io> 
主题: [edk2-devel] empty USB DVD disk hang Xhci 

  

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.  



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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.  



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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 (#107448): https://edk2.groups.io/g/devel/message/107448
Mute This Topic: https://groups.io/mt/100499894/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] empty USB DVD disk hang Xhci
Posted by Chao Li 9 months ago
Hi Likun,

I'm saw this PR was blocked by some CI entries, and it looks like the 
coding style ECC check is failing, details message are on the azure CI 
site: 
https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=99105&view=ms.vss-test-web.build-test-results-tab&runId=864236&resultId=100010&paneView=attachments. 


CI has given the recommondations, refer to following image:


Please modify your patch as suggested by CI:

1. Reduce the spaces between "EPRing" and "=".

2. Add a new blank line at the end of the code you added.

And then you can submit PR again.


Liming,

Please create the new push label after Likun finished. Thank you!


Thanks,
Chao
在 2023/8/2 13:29, gaoliming via groups.io 写道:
>
> https://github.com/tianocore/edk2/pull/4709 is created to merge this 
> patch.
>
> Thanks
>
> Liming
>
> *发件人:*devel@edk2.groups.io <devel@edk2.groups.io> *代表 *Chao Li
> *发送时间:*2023年7月27日15:24
> *收件人:*devel@edk2.groups.io; sulikun@loongson.cn; Wu, Hao A 
> <hao.a.wu@intel.com>
> *抄送:*Gao, Liming <gaoliming@byosoft.com.cn>; Demeter, Miki 
> <miki.demeter@intel.com>
> *主题:*Re: [edk2-devel] empty USB DVD disk hang Xhci
>
> Hi Likun,
>
> Liming and Hao have reviewd and acked your patch, I think you can 
> submit your patch on edk2 repo and don't forget include Liming and Hao 
> review message. Good job!
>
> Thanks,
> Chao
>
> 在2023/7/27 11:21, 苏丽坤 写道:
>
>     Hi, Hao,Liming,
>
>        this is my reply,function XhcInitializeDeviceSlot64 will init
>     EndpointTransferRing,while fuctionUsbMassReadBlocks return
>     (Invalid Parameter), which result in run function UsbMassReset,
>     this will call  XhcDisableSlotCmd64, will clear
>     EndpointTransferRing, like
>     this Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] =
>     NULL;  If  fuctionUsbMassReadBlocks returnsuccess also run
>     function UsbMassReset, will hang for the same reason. why
>     fuctionUsbMassReadBlocks return (Invalid Parameter), this function
>     will call UsbBootRequestSense,this retun (Invalid Parameter). At
>     the same time, Ehci also retun (Invalid Parameter).
>
>     Thanks
>
>         -----原始邮件-----
>         *发件人:*"Wu, Hao A" <hao.a.wu@intel.com>
>         <mailto:hao.a.wu@intel.com>
>         *发送时间:*2023-07-25 10:18:42 (星期二)
>         *收件人:*"Gao, Liming" <gaoliming@byosoft.com.cn>
>         <mailto:gaoliming@byosoft.com.cn>, "devel@edk2.groups.io"
>         <mailto:devel@edk2.groups.io> <devel@edk2.groups.io>
>         <mailto:devel@edk2.groups.io>, "sulikun@loongson.cn"
>         <mailto:sulikun@loongson.cn> <sulikun@loongson.cn>
>         <mailto:sulikun@loongson.cn>, "Demeter, Miki"
>         <miki.demeter@intel.com> <mailto:miki.demeter@intel.com>
>         *主题:*RE: [edk2-devel] empty USB DVD disk hang Xhci
>
>         Sorry, I do not have much resource to review this in detail.
>         But the patch generally looks good to me:
>
>         Acked-by: Hao A Wu hao.a.wu@intel.com
>
>         However, I hope the below question can be answered (or add
>         related information to the commit log message) before mering:
>
>         Likun, could you help to elaborate a bit more on why the below
>         statement will return NULL pointer for “USB DVD with empty disk”?
>
>         EPRing        = (TRANSFER_RING
>         *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];
>
>         Best Regards,
>
>         Hao Wu
>
>         *From:*gaoliming <gaoliming@byosoft.com.cn>
>         <mailto:gaoliming@byosoft.com.cn>
>         *Sent:* Tuesday, July 25, 2023 9:44 AM
>         *To:* devel@edk2.groups.io; sulikun@loongson.cn; Demeter, Miki
>         <miki.demeter@intel.com> <mailto:miki.demeter@intel.com>
>         *Cc:* Wu, Hao A <hao.a.wu@intel.com> <mailto:hao.a.wu@intel.com>
>         *Subject:* 回复: [edk2-devel] empty USB DVD disk hang Xhci
>
>         Likun:
>
>          This change is good to me.  Reviewed-by: Liming Gao
>         <gaoliming@byosoft.com.cn>
>
>         Hao:
>
>          Have you time to review this fix?
>
>         Thanks
>
>         Liming
>
>         *发件人:*devel@edk2.groups.io <devel@edk2.groups.io> *代表 *苏丽坤
>         *发送时间:*2023年7月18日9:49
>         *收件人:*gaoliming@byosoft.com.cn; miki.demeter@intel.com;
>         devel@edk2.groups.io
>         *主题:*[edk2-devel] empty USB DVD disk hang Xhci
>
>         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. /
>
>
>
>         /本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。//
>         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. /
>
>
>
>     /本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。//
>     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 (#107480): https://edk2.groups.io/g/devel/message/107480
Mute This Topic: https://groups.io/mt/100519473/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-


Re: [edk2-devel] empty USB DVD disk hang Xhci
Posted by 苏丽坤 9 months ago
Hi Liming,chao




https://github.com/tianocore/edk2/pull/4715 is created to merge this patch, modify as suggested by CI







Thanks

-----原始邮件-----
发件人:"Chao Li" <lichao@loongson.cn>
发送时间:2023-08-03 10:44:28 (星期四)
收件人: devel@edk2.groups.io, gaoliming@byosoft.com.cn, sulikun@loongson.cn, "'Wu, Hao A'" <hao.a.wu@intel.com>
抄送: "'Demeter, Miki'" <miki.demeter@intel.com>
主题: Re: [edk2-devel] empty USB DVD disk hang Xhci



Hi Likun,

I'm saw this PR was blocked by some CI entries, and it looks like the coding style ECC check is failing, details message are on the azure CI site: https://dev.azure.com/tianocore/edk2-ci/_build/results?buildId=99105&view=ms.vss-test-web.build-test-results-tab&runId=864236&resultId=100010&paneView=attachments.


CI has given the recommondations, refer to following image:




Please modify your patch as suggested by CI:

1. Reduce the spaces between "EPRing" and "=".

2. Add a new blank line at the end of the code you added.

And then you can submit PR again.





Liming,

Please create the new push label after Likun finished. Thank you!




Thanks,
Chao

在 2023/8/2 13:29, gaoliming via groups.io 写道:


https://github.com/tianocore/edk2/pull/4709 is created to merge this patch.

 

Thanks

Liming

发件人:devel@edk2.groups.io<devel@edk2.groups.io>代表 Chao Li
发送时间: 2023年7月27日 15:24
收件人:devel@edk2.groups.io; sulikun@loongson.cn; Wu, Hao A <hao.a.wu@intel.com>
抄送: Gao, Liming <gaoliming@byosoft.com.cn>; Demeter, Miki <miki.demeter@intel.com>
主题: Re: [edk2-devel] empty USB DVD disk hang Xhci

 

Hi Likun,

Liming and Hao have reviewd and acked your patch, I think you can submit your patch on edk2 repo and don't forget include Liming and Hao review message. Good job!

 

Thanks,
Chao

在 2023/7/27 11:21, 苏丽坤 写道:

Hi, Hao,Liming,

 

   this is my reply, function XhcInitializeDeviceSlot64 will init EndpointTransferRing,while fuctionUsbMassReadBlocks return (Invalid Parameter), which result in run function UsbMassReset, this will call  XhcDisableSlotCmd64, will clear EndpointTransferRing, like this Xhc->UsbDevContext[SlotId].EndpointTransferRing[Index] = NULL;  If  fuctionUsbMassReadBlocks return success also run function UsbMassReset, will hang for the same reason. why fuctionUsbMassReadBlocks return (Invalid Parameter), this function will call UsbBootRequestSense,this retun (Invalid Parameter). At the same time, Ehci also retun  (Invalid Parameter).

 

Thanks 



-----原始邮件-----
发件人: "Wu, Hao A" <hao.a.wu@intel.com>
发送时间: 2023-07-25 10:18:42 (星期二)
收件人: "Gao, Liming" <gaoliming@byosoft.com.cn>, "devel@edk2.groups.io"<devel@edk2.groups.io>, "sulikun@loongson.cn"<sulikun@loongson.cn>, "Demeter, Miki" <miki.demeter@intel.com>
主题: RE: [edk2-devel] empty USB DVD disk hang Xhci

Sorry, I do not have much resource to review this in detail. But the patch generally looks good to me:

Acked-by: Hao A Wu hao.a.wu@intel.com

 

However, I hope the below question can be answered (or add related information to the commit log message) before mering:

Likun, could you help to elaborate a bit more on why the below statement will return NULL pointer for “USB DVD with empty disk”?

EPRing        = (TRANSFER_RING *)(UINTN)Xhc->UsbDevContext[SlotId].EndpointTransferRing[Dci-1];

 

 

Best Regards,

Hao Wu

 

From: gaoliming <gaoliming@byosoft.com.cn>
Sent: Tuesday, July 25, 2023 9:44 AM
To:devel@edk2.groups.io; sulikun@loongson.cn; Demeter, Miki <miki.demeter@intel.com>
Cc: Wu, Hao A <hao.a.wu@intel.com>
Subject:回复: [edk2-devel] empty USB DVD disk hang Xhci

 

Likun:

 This change is good to me.  Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>

 

Hao:

 Have you time to review this fix?

 

Thanks

Liming

发件人:devel@edk2.groups.io <devel@edk2.groups.io> 代表 苏丽坤
发送时间: 2023年7月18日 9:49
收件人:gaoliming@byosoft.com.cn; miki.demeter@intel.com; devel@edk2.groups.io
主题: [edk2-devel] empty USB DVD disk hang Xhci

 

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. 



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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. 



本邮件及其附件含有龙芯中科的商业秘密信息,仅限于发送给上面地址中列出的个人或群组。禁止任何其他人以任何形式使用(包括但不限于全部或部分地泄露、复制或散发)本邮件及其附件中的信息。如果您错收本邮件,请您立即电话或邮件通知发件人并删除本邮件。 
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 (#107533): https://edk2.groups.io/g/devel/message/107533
Mute This Topic: https://groups.io/mt/100519473/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-