public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Xianglei Cai" <xianglei.cai@intel.com>
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
Date: Thu, 25 Apr 2024 09:57:42 +0000	[thread overview]
Message-ID: <MN0PR11MB6034FE79C124DDFC6A5F2B8B93172@MN0PR11MB6034.namprd11.prod.outlook.com> (raw)
In-Reply-To: <MN0PR11MB60342B4BCFEEDD3E0C9C58D5930E2@MN0PR11MB6034.namprd11.prod.outlook.com>

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]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-04-25  9:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN0PR11MB6034FE79C124DDFC6A5F2B8B93172@MN0PR11MB6034.namprd11.prod.outlook.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox