* [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error [not found] <cover.1713164057.git.xianglei.cai@intel.com> @ 2024-04-15 6:54 ` Xianglei Cai 2024-04-15 9:51 ` 回复: " gaoliming via groups.io 0 siblings, 1 reply; 11+ messages in thread From: Xianglei Cai @ 2024-04-15 6:54 UTC (permalink / raw) To: devel Cc: Xianglei Cai, Ray Ni, Liming Gao, Krzysztof Lewandowski, Jenny Huang, More Shih https://bugzilla.tianocore.org/show_bug.cgi?id=4556 Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur. Add the error code for USB Transaction error since UEFI spec don't have the related definition. Cc: Ray Ni <ray.ni@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> Cc: Jenny Huang <jenny.huang@intel.com> Cc: More Shih <more.shih@intel.com> Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index f4e61d223c1b..cf6b32959e68 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -825,7 +825,10 @@ XhcTransfer ( *TransferResult = Urb->Result; *DataLength = Urb->Completed; - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) { + // + // Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur. + // + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE) || (*TransferResult == EDKII_USB_ERR_TRANSACTION)) { ASSERT (Status == EFI_DEVICE_ERROR); RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); if (EFI_ERROR (RecoveryStatus)) { diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index 5d735008ba31..a97ed44dbfc3 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! Completecode = %x\n", EvtTrb->Completecode)); goto EXIT; + // + // Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur. + // case TRB_COMPLETION_USB_TRANSACTION_ERROR: - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; CheckedUrb->Finished = TRUE; DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); goto EXIT; diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h index 7c85f7993b5c..e606e212a1d3 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #define TRB_COMPLETION_STOPPED 26 #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 +// +// USB Transfer Results Internal Definition +// Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur. +// Add the error code for USB Transaction error since UEFI spec don't have the related definition. +// +#define EDKII_USB_ERR_TRANSACTION 0x200 + // // The topology string used to present usb device location // -- 2.42.0.windows.2 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117761): https://edk2.groups.io/g/devel/message/117761 Mute This Topic: https://groups.io/mt/105531494/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply related [flat|nested] 11+ messages in thread
* 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-15 6:54 ` [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Xianglei Cai @ 2024-04-15 9:51 ` gaoliming via groups.io 2024-04-18 8:58 ` Xianglei Cai 0 siblings, 1 reply; 11+ messages in thread From: gaoliming via groups.io @ 2024-04-15 9:51 UTC (permalink / raw) To: devel, xianglei.cai Cc: 'Ray Ni', 'Krzysztof Lewandowski', 'Jenny Huang', 'More Shih' Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月15日 14:55 > 收件人: devel@edk2.groups.io > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni <ray.ni@intel.com>; > Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof Lewandowski > <krzysztof.lewandowski@intel.com>; Jenny Huang <jenny.huang@intel.com>; > More Shih <more.shih@intel.com> > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint > while USB Transaction error > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > Based on XHCI spec 4.8.3, software should do the > reset endpoint while USB Transaction occur. > Add the error code for USB Transaction error > since UEFI spec don't have the related definition. > > Cc: Ray Ni <ray.ni@intel.com> > Cc: Liming Gao <gaoliming@byosoft.com.cn> > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > Cc: Jenny Huang <jenny.huang@intel.com> > Cc: More Shih <more.shih@intel.com> > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > 3 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index f4e61d223c1b..cf6b32959e68 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -825,7 +825,10 @@ XhcTransfer ( > *TransferResult = Urb->Result; > *DataLength = Urb->Completed; > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE)) { > + // > + // Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > + // > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE) || (*TransferResult == > EDKII_USB_ERR_TRANSACTION)) { > ASSERT (Status == EFI_DEVICE_ERROR); > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > index 5d735008ba31..a97ed44dbfc3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > > + // > + // Based on XHCI spec 4.8.3, software should do the reset endpoint > while USB Transaction occur. > + // > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > CheckedUrb->Finished = TRUE; > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > index 7c85f7993b5c..e606e212a1d3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #define TRB_COMPLETION_STOPPED 26 > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > +// > +// USB Transfer Results Internal Definition > +// Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > +// Add the error code for USB Transaction error since UEFI spec don't have > the related definition. > +// > +#define EDKII_USB_ERR_TRANSACTION 0x200 > + > // > // The topology string used to present usb device location > // > -- > 2.42.0.windows.2 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117771): https://edk2.groups.io/g/devel/message/117771 Mute This Topic: https://groups.io/mt/105532714/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-15 9:51 ` 回复: " gaoliming via groups.io @ 2024-04-18 8:58 ` Xianglei Cai 2024-04-25 9:57 ` Xianglei Cai 0 siblings, 1 reply; 11+ messages in thread From: Xianglei Cai @ 2024-04-18 8:58 UTC (permalink / raw) To: gaoliming, devel@edk2.groups.io Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny, Shih, More Hi Liming, Could you help pick the change to the master branch? Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn> Sent: Monday, April 15, 2024 5:52 PM To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月15日 14:55 > 收件人: devel@edk2.groups.io > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni <ray.ni@intel.com>; > Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof Lewandowski > <krzysztof.lewandowski@intel.com>; Jenny Huang > <jenny.huang@intel.com>; More Shih <more.shih@intel.com> > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint > while USB Transaction error > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > Add the error code for USB Transaction error since UEFI spec don't > have the related definition. > > Cc: Ray Ni <ray.ni@intel.com> > Cc: Liming Gao <gaoliming@byosoft.com.cn> > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > Cc: Jenny Huang <jenny.huang@intel.com> > Cc: More Shih <more.shih@intel.com> > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > 3 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index f4e61d223c1b..cf6b32959e68 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -825,7 +825,10 @@ XhcTransfer ( > *TransferResult = Urb->Result; > *DataLength = Urb->Completed; > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE)) { > + // > + // Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > + // > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE) || (*TransferResult == > EDKII_USB_ERR_TRANSACTION)) { > ASSERT (Status == EFI_DEVICE_ERROR); > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { diff --git > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > index 5d735008ba31..a97ed44dbfc3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > > + // > + // Based on XHCI spec 4.8.3, software should do the reset > + endpoint > while USB Transaction occur. > + // > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > CheckedUrb->Finished = TRUE; > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > index 7c85f7993b5c..e606e212a1d3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #define TRB_COMPLETION_STOPPED 26 > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > +// > +// USB Transfer Results Internal Definition // Based on XHCI spec > +4.8.3, software should do the reset endpoint while > USB Transaction occur. > +// Add the error code for USB Transaction error since UEFI spec don't have > the related definition. > +// > +#define EDKII_USB_ERR_TRANSACTION 0x200 > + > // > // The topology string used to present usb device location // > -- > 2.42.0.windows.2 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117968): https://edk2.groups.io/g/devel/message/117968 Mute This Topic: https://groups.io/mt/105594486/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-18 8:58 ` Xianglei Cai @ 2024-04-25 9:57 ` Xianglei Cai 2024-04-26 8:44 ` 回复: " gaoliming via groups.io 0 siblings, 1 reply; 11+ messages in thread From: Xianglei Cai @ 2024-04-25 9:57 UTC (permalink / raw) To: gaoliming, devel@edk2.groups.io Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny, Shih, More Hi @gaoliming Could you provide the eta when the patch can be merged? Thanks, Xianglei -----Original Message----- From: Cai, Xianglei Sent: Thursday, April 18, 2024 4:59 PM To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Liming, Could you help pick the change to the master branch? Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn> Sent: Monday, April 15, 2024 5:52 PM To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月15日 14:55 > 收件人: devel@edk2.groups.io > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni <ray.ni@intel.com>; > Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof Lewandowski > <krzysztof.lewandowski@intel.com>; Jenny Huang > <jenny.huang@intel.com>; More Shih <more.shih@intel.com> > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint > while USB Transaction error > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > Add the error code for USB Transaction error since UEFI spec don't > have the related definition. > > Cc: Ray Ni <ray.ni@intel.com> > Cc: Liming Gao <gaoliming@byosoft.com.cn> > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > Cc: Jenny Huang <jenny.huang@intel.com> > Cc: More Shih <more.shih@intel.com> > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > 3 files changed, 15 insertions(+), 2 deletions(-) > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index f4e61d223c1b..cf6b32959e68 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -825,7 +825,10 @@ XhcTransfer ( > *TransferResult = Urb->Result; > *DataLength = Urb->Completed; > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE)) { > + // > + // Based on XHCI spec 4.8.3, software should do the reset endpoint while > USB Transaction occur. > + // > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > EFI_USB_ERR_BABBLE) || (*TransferResult == > EDKII_USB_ERR_TRANSACTION)) { > ASSERT (Status == EFI_DEVICE_ERROR); > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { diff --git > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > index 5d735008ba31..a97ed44dbfc3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > > + // > + // Based on XHCI spec 4.8.3, software should do the reset > + endpoint > while USB Transaction occur. > + // > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > CheckedUrb->Finished = TRUE; > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > goto EXIT; > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > index 7c85f7993b5c..e606e212a1d3 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > #define TRB_COMPLETION_STOPPED 26 > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > +// > +// USB Transfer Results Internal Definition // Based on XHCI spec > +4.8.3, software should do the reset endpoint while > USB Transaction occur. > +// Add the error code for USB Transaction error since UEFI spec don't have > the related definition. > +// > +#define EDKII_USB_ERR_TRANSACTION 0x200 > + > // > // The topology string used to present usb device location // > -- > 2.42.0.windows.2 > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118284): https://edk2.groups.io/g/devel/message/118284 Mute This Topic: https://groups.io/mt/105594486/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 11+ messages in thread
* 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-25 9:57 ` Xianglei Cai @ 2024-04-26 8:44 ` gaoliming via groups.io 2024-04-26 9:13 ` Xianglei Cai 0 siblings, 1 reply; 11+ messages in thread From: gaoliming via groups.io @ 2024-04-26 8:44 UTC (permalink / raw) To: devel, xianglei.cai Cc: 'Ni, Ray', 'Lewandowski, Krzysztof', 'Huang, Jenny', 'Shih, More' Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > 抄送: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; > Shih, More <more.shih@intel.com> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; > Shih, More <more.shih@intel.com> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn> > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; > Shih, More <more.shih@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > > > -----邮件原件----- > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io > > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni <ray.ni@intel.com>; > > Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof Lewandowski > > <krzysztof.lewandowski@intel.com>; Jenny Huang > > <jenny.huang@intel.com>; More Shih <more.shih@intel.com> > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Liming Gao <gaoliming@byosoft.com.cn> > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > Cc: Jenny Huang <jenny.huang@intel.com> > > Cc: More Shih <more.shih@intel.com> > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118320): https://edk2.groups.io/g/devel/message/118320 Mute This Topic: https://groups.io/mt/105746896/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-26 8:44 ` 回复: " gaoliming via groups.io @ 2024-04-26 9:13 ` Xianglei Cai 2024-05-06 3:33 ` Shih, More 0 siblings, 1 reply; 11+ messages in thread From: Xianglei Cai @ 2024-04-26 9:13 UTC (permalink / raw) To: gaoliming, devel@edk2.groups.io Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny, Shih, More I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn> Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > 抄送: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn> > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > > > -----邮件原件----- > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io > > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni > > <ray.ni@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com>; Jenny Huang > > <jenny.huang@intel.com>; More Shih <more.shih@intel.com> > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Liming Gao <gaoliming@byosoft.com.cn> > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > Cc: Jenny Huang <jenny.huang@intel.com> > > Cc: More Shih <more.shih@intel.com> > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118321): https://edk2.groups.io/g/devel/message/118321 Mute This Topic: https://groups.io/mt/105747124/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-04-26 9:13 ` Xianglei Cai @ 2024-05-06 3:33 ` Shih, More 2024-05-07 1:11 ` 回复: " gaoliming via groups.io 0 siblings, 1 reply; 11+ messages in thread From: Shih, More @ 2024-05-06 3:33 UTC (permalink / raw) To: Cai, Xianglei, gaoliming, devel@edk2.groups.io Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny [-- Attachment #1: Type: text/plain, Size: 7536 bytes --] Hi Gaoliming, Could you help push the PR ? BR, More Shih ________________________________ From: Cai, Xianglei <xianglei.cai@intel.com> Sent: Friday, April 26, 2024 5:13 PM To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io <devel@edk2.groups.io> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn> Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > 抄送: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn> > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com> > Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com>; Huang, Jenny > <jenny.huang@intel.com>; Shih, More <more.shih@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> > > > -----邮件原件----- > > 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io > > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni > > <ray.ni@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com>; Jenny Huang > > <jenny.huang@intel.com>; More Shih <more.shih@intel.com> > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com> > > Cc: Liming Gao <gaoliming@byosoft.com.cn> > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > Cc: Jenny Huang <jenny.huang@intel.com> > > Cc: More Shih <more.shih@intel.com> > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com> > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118696): https://edk2.groups.io/g/devel/message/118696 Mute This Topic: https://groups.io/mt/105747124/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 12541 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-05-06 3:33 ` Shih, More @ 2024-05-07 1:11 ` gaoliming via groups.io 2024-05-07 1:23 ` Xianglei Cai 0 siblings, 1 reply; 11+ messages in thread From: gaoliming via groups.io @ 2024-05-07 1:11 UTC (permalink / raw) To: 'Shih, More', 'Cai, Xianglei', devel Cc: 'Ni, Ray', 'Lewandowski, Krzysztof', 'Huang, Jenny' [-- Attachment #1: Type: text/plain, Size: 9796 bytes --] I will merge it this week. 发件人: Shih, More <more.shih@intel.com> 发送时间: 2024年5月6日 11:34 收件人: Cai, Xianglei <xianglei.cai@intel.com>; gaoliming <gaoliming@byosoft.com.cn>; devel@edk2.groups.io 抄送: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com> 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Gaoliming, Could you help push the PR ? BR, More Shih _____ From: Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > Sent: Friday, April 26, 2024 5:13 PM To: gaoliming <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> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel. com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel. com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io> > 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com. cn> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> > 抄送: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more. shih@intel.com <mailto:more.shih@intel.com> > > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more. shih@intel.com <mailto:more.shih@intel.com> > > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more. shih@intel.com <mailto:more.shih@intel.com> > > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <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> > 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> > > 抄送: Xianglei Cai <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> >; Ray Ni > > <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Jenny Huang > > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; More Shih <more.shih@intel.com <mailto:more.shih@intel.com> > > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com <mailto:ray.ni@intel.com> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com> > > Cc: Jenny Huang <jenny.huang@intel.com <mailto:jenny.huang@intel.com> > > > Cc: More Shih <more.shih@intel.com <mailto:more.shih@intel.com> > > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> > > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118618): https://edk2.groups.io/g/devel/message/118618 Mute This Topic: https://groups.io/mt/105952289/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 18262 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-05-07 1:11 ` 回复: " gaoliming via groups.io @ 2024-05-07 1:23 ` Xianglei Cai 2024-05-07 1:26 ` 回复: " gaoliming via groups.io 0 siblings, 1 reply; 11+ messages in thread From: Xianglei Cai @ 2024-05-07 1:23 UTC (permalink / raw) To: gaoliming, Shih, More, devel@edk2.groups.io Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny [-- Attachment #1: Type: text/plain, Size: 10603 bytes --] Hi Liming, I create one pull request: MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error by Xianglei-Cai · Pull Request #5631 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/5631>. Is it helpful for merge the change? Thanks, Xianglei From: gaoliming <gaoliming@byosoft.com.cn> Sent: Tuesday, May 7, 2024 9:12 AM To: Shih, More <more.shih@intel.com>; Cai, Xianglei <xianglei.cai@intel.com>; devel@edk2.groups.io Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I will merge it this week. 发件人: Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> 发送时间: 2024年5月6日 11:34 收件人: Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>>; gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> 抄送: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Gaoliming, Could you help push the PR ? BR, More Shih ________________________________ From: Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> Sent: Friday, April 26, 2024 5:13 PM To: gaoliming <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>> Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> > 抄送: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> > Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> > Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <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>> 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > > 抄送: Xianglei Cai <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>>; Ray Ni > > <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Jenny Huang > > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; More Shih <more.shih@intel.com<mailto:more.shih@intel.com>> > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>> > > Cc: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>> > > Cc: Jenny Huang <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> > > Cc: More Shih <more.shih@intel.com<mailto:more.shih@intel.com>> > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>> > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118619): https://edk2.groups.io/g/devel/message/118619 Mute This Topic: https://groups.io/mt/105952466/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 21124 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-05-07 1:23 ` Xianglei Cai @ 2024-05-07 1:26 ` gaoliming via groups.io 2024-05-07 2:28 ` Xianglei Cai 0 siblings, 1 reply; 11+ messages in thread From: gaoliming via groups.io @ 2024-05-07 1:26 UTC (permalink / raw) To: devel, xianglei.cai, 'Shih, More' Cc: 'Ni, Ray', 'Lewandowski, Krzysztof', 'Huang, Jenny' [-- Attachment #1: Type: text/plain, Size: 11544 bytes --] Yes. I just add PUSH label. If it passes CI, it will be merged. 发件人: devel@edk2.groups.io <devel@edk2.groups.io> 代表 Xianglei Cai 发送时间: 2024年5月7日 9:24 收件人: gaoliming <gaoliming@byosoft.com.cn>; Shih, More <more.shih@intel.com>; devel@edk2.groups.io 抄送: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com> 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Liming, I create one pull request: MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error by Xianglei-Cai · Pull Request #5631 · tianocore/edk2 (github.com) <https://github.com/tianocore/edk2/pull/5631> . Is it helpful for merge the change? Thanks, Xianglei From: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > Sent: Tuesday, May 7, 2024 9:12 AM To: Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> >; Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel.com <mailto:jenny.huang@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I will merge it this week. 发件人: Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > 发送时间: 2024年5月6日 11:34 收件人: Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> >; gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> 抄送: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel.com <mailto:jenny.huang@intel.com> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Gaoliming, Could you help push the PR ? BR, More Shih _____ From: Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > Sent: Friday, April 26, 2024 5:13 PM To: gaoliming <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> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> <devel@edk2.groups.io <mailto:devel@edk2.groups.io> > 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> > 抄送: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; devel@edk2.groups.io <mailto:devel@edk2.groups.io> > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io <mailto:devel@edk2.groups.io> ; Cai, Xianglei <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > > Cc: Ni, Ray <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Huang, Jenny > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; Shih, More <more.shih@intel.com <mailto:more.shih@intel.com> > > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <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> > 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io <mailto:devel@edk2.groups.io> > > 抄送: Xianglei Cai <xianglei.cai@intel.com>; Ray Ni > > <ray.ni@intel.com <mailto:ray.ni@intel.com> >; Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> >; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> >; Jenny Huang > > <jenny.huang@intel.com <mailto:jenny.huang@intel.com> >; More Shih <more.shih@intel.com <mailto:more.shih@intel.com> > > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com <mailto:ray.ni@intel.com> > > > Cc: Liming Gao <gaoliming@byosoft.com.cn <mailto:gaoliming@byosoft.com.cn> > > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> > > > Cc: Jenny Huang <jenny.huang@intel.com <mailto:jenny.huang@intel.com> > > > Cc: More Shih <more.shih@intel.com <mailto:more.shih@intel.com> > > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com <mailto:xianglei.cai@intel.com> > > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com <mailto:krzysztof.lewandowski@intel.com> > > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118622): https://edk2.groups.io/g/devel/message/118622 Mute This Topic: https://groups.io/mt/105952503/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 22964 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error 2024-05-07 1:26 ` 回复: " gaoliming via groups.io @ 2024-05-07 2:28 ` Xianglei Cai 0 siblings, 0 replies; 11+ messages in thread From: Xianglei Cai @ 2024-05-07 2:28 UTC (permalink / raw) To: gaoliming, devel@edk2.groups.io, Shih, More Cc: Ni, Ray, Lewandowski, Krzysztof, Huang, Jenny [-- Attachment #1: Type: text/plain, Size: 12237 bytes --] Thanks Liming. The patch already merged: MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error · tianocore/edk2@c12bbc1 (github.com)<https://github.com/tianocore/edk2/commit/c12bbc14900aa5c70eec8c0576757c2182db3d01> From: gaoliming <gaoliming@byosoft.com.cn> Sent: Tuesday, May 7, 2024 9:27 AM To: devel@edk2.groups.io; Cai, Xianglei <xianglei.cai@intel.com>; Shih, More <more.shih@intel.com> Cc: Ni, Ray <ray.ni@intel.com>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jenny <jenny.huang@intel.com> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Yes. I just add PUSH label. If it passes CI, it will be merged. 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 Xianglei Cai 发送时间: 2024年5月7日 9:24 收件人: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> 抄送: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Liming, I create one pull request: MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error by Xianglei-Cai · Pull Request #5631 · tianocore/edk2 (github.com)<https://github.com/tianocore/edk2/pull/5631>. Is it helpful for merge the change? Thanks, Xianglei From: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Sent: Tuesday, May 7, 2024 9:12 AM To: Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>>; Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I will merge it this week. 发件人: Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> 发送时间: 2024年5月6日 11:34 收件人: Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>>; gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> 抄送: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Hi Gaoliming, Could you help push the PR ? BR, More Shih ________________________________ From: Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> Sent: Friday, April 26, 2024 5:13 PM To: gaoliming <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>> Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error I have no access to push PR. But I tried with my personal fork, it can pass CI. Thanks, Xianglei -----Original Message----- From: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> Sent: Friday, April 26, 2024 4:44 PM To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Can you create PR for this patch? If it passes CI, I will add push label. Thanks Liming > -----邮件原件----- > 发件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> <devel@edk2.groups.io<mailto:devel@edk2.groups.io>> 代表 Xianglei Cai > 发送时间: 2024年4月25日 17:58 > 收件人: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> > 抄送: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > 主题: Re: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi @gaoliming > > Could you provide the eta when the patch can be merged? > > Thanks, > Xianglei > > -----Original Message----- > From: Cai, Xianglei > Sent: Thursday, April 18, 2024 4:59 PM > To: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; devel@edk2.groups.io<mailto:devel@edk2.groups.io> > Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > Subject: RE: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Hi Liming, > > Could you help pick the change to the master branch? > > Thanks, > Xianglei > > -----Original Message----- > From: gaoliming <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> > Sent: Monday, April 15, 2024 5:52 PM > To: devel@edk2.groups.io<mailto:devel@edk2.groups.io>; Cai, Xianglei <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> > Cc: Ni, Ray <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Lewandowski, Krzysztof > <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Huang, Jenny > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; Shih, More <more.shih@intel.com<mailto:more.shih@intel.com>> > Subject: 回复: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint while USB Transaction error > > Reviewed-by: Liming Gao <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>> 代表 Xianglei > Cai > > 发送时间: 2024年4月15日 14:55 > > 收件人: devel@edk2.groups.io<mailto:devel@edk2.groups.io> > > 抄送: Xianglei Cai <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>>; Ray Ni > > <ray.ni@intel.com<mailto:ray.ni@intel.com>>; Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>>; Krzysztof > > Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>>; Jenny Huang > > <jenny.huang@intel.com<mailto:jenny.huang@intel.com>>; More Shih <more.shih@intel.com<mailto:more.shih@intel.com>> > > 主题: [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset > endpoint > > while USB Transaction error > > > > https://bugzilla.tianocore.org/show_bug.cgi?id=4556 > > > > Based on XHCI spec 4.8.3, software should do the reset endpoint > > while USB Transaction occur. > > Add the error code for USB Transaction error since UEFI spec don't > > have the related definition. > > > > Cc: Ray Ni <ray.ni@intel.com<mailto:ray.ni@intel.com>> > > Cc: Liming Gao <gaoliming@byosoft.com.cn<mailto:gaoliming@byosoft.com.cn>> > > Cc: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>> > > Cc: Jenny Huang <jenny.huang@intel.com<mailto:jenny.huang@intel.com>> > > Cc: More Shih <more.shih@intel.com<mailto:more.shih@intel.com>> > > Signed-off-by: Xianglei Cai <xianglei.cai@intel.com<mailto:xianglei.cai@intel.com>> > > Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.com<mailto:krzysztof.lewandowski@intel.com>> > > --- > > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 5 ++++- > > MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h | 7 +++++++ > > 3 files changed, 15 insertions(+), 2 deletions(-) > > > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > index f4e61d223c1b..cf6b32959e68 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > > @@ -825,7 +825,10 @@ XhcTransfer ( > > *TransferResult = Urb->Result; > > *DataLength = Urb->Completed; > > > > - if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE)) { > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > while > > USB Transaction occur. > > + // > > + if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == > > EFI_USB_ERR_BABBLE) || (*TransferResult == > > EDKII_USB_ERR_TRANSACTION)) { > > ASSERT (Status == EFI_DEVICE_ERROR); > > RecoveryStatus = XhcRecoverHaltedEndpoint (Xhc, Urb); > > if (EFI_ERROR (RecoveryStatus)) { diff --git > > a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > index 5d735008ba31..a97ed44dbfc3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c > > @@ -1192,8 +1192,11 @@ XhcCheckUrbResult ( > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: ERR_BUFFER! > > Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > > > + // > > + // Based on XHCI spec 4.8.3, software should do the reset > > + endpoint > > while USB Transaction occur. > > + // > > case TRB_COMPLETION_USB_TRANSACTION_ERROR: > > - CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT; > > + CheckedUrb->Result |= EDKII_USB_ERR_TRANSACTION; > > CheckedUrb->Finished = TRUE; > > DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: > > TRANSACTION_ERROR! Completecode = %x\n", EvtTrb->Completecode)); > > goto EXIT; > > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > index 7c85f7993b5c..e606e212a1d3 100644 > > --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.h > > @@ -78,6 +78,13 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #define TRB_COMPLETION_STOPPED 26 > > #define TRB_COMPLETION_STOPPED_LENGTH_INVALID 27 > > > > +// > > +// USB Transfer Results Internal Definition // Based on XHCI spec > > +4.8.3, software should do the reset endpoint while > > USB Transaction occur. > > +// Add the error code for USB Transaction error since UEFI spec > > +don't > have > > the related definition. > > +// > > +#define EDKII_USB_ERR_TRANSACTION 0x200 > > + > > // > > // The topology string used to present usb device location // > > -- > > 2.42.0.windows.2 > > > > > > > > > > > > > > > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118626): https://edk2.groups.io/g/devel/message/118626 Mute This Topic: https://groups.io/mt/105953426/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=- [-- Attachment #2: Type: text/html, Size: 24887 bytes --] ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2024-05-08 16:32 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- [not found] <cover.1713164057.git.xianglei.cai@intel.com> 2024-04-15 6:54 ` [edk2-devel] [PATCH V2 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Xianglei Cai 2024-04-15 9:51 ` 回复: " gaoliming via groups.io 2024-04-18 8:58 ` Xianglei Cai 2024-04-25 9:57 ` Xianglei Cai 2024-04-26 8:44 ` 回复: " gaoliming via groups.io 2024-04-26 9:13 ` Xianglei Cai 2024-05-06 3:33 ` Shih, More 2024-05-07 1:11 ` 回复: " gaoliming via groups.io 2024-05-07 1:23 ` Xianglei Cai 2024-05-07 1:26 ` 回复: " gaoliming via groups.io 2024-05-07 2:28 ` Xianglei Cai
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox