From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail04.groups.io (mail04.groups.io [45.79.224.9]) by spool.mail.gandi.net (Postfix) with ESMTPS id 2F941D800FF for ; Mon, 15 Apr 2024 05:23:19 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=L+CyRbCMkWrFlAGTDYy9fs8wLDfOeKfwnuLwEzOLGbc=; c=relaxed/simple; d=groups.io; h=From:To:Cc:References:In-Reply-To:Subject:Date:Message-ID:MIME-Version:Thread-Index:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Language; s=20240206; t=1713158598; v=1; b=j2thF96ppu+OG7Lf1gJ8BrNFFXnpejLsr3ZMJv9ERTXg+XEIwK89JNMuFCqgH+iqV/N5msSM ZK7DkP9MM1f/Ymjr6PZL+1TFn47ZZJkRmbpPiOh4pe68Gf7tnjoqQUnWRhdrb0CnHITpyCemPYC Hzj6ya1TwcVs5sx0j4fhnV8Za5dYny/3hcyy+UIYAZkVeTC74KjWsKD8+yG9+7BLB9QkrsKo+QX oeC1f2BxErxnOKiuli5md07PxwohCcKkJFnti3l8yXp4xn3bQJU728oEsaFWwqg5eraJIBfpoW4 OV0+B2Qgu0J3tGRTHOISg753isRY1/vNqk2ROb/QsiYYA== X-Received: by 127.0.0.2 with SMTP id J9vQYY7687511xOOnXBu2ZkY; Sun, 14 Apr 2024 22:23:18 -0700 X-Received: from cxsh.intel-email.com (cxsh.intel-email.com [121.46.250.151]) by mx.groups.io with SMTP id smtpd.web10.14136.1713158596982231790 for ; Sun, 14 Apr 2024 22:23:18 -0700 X-Received: from cxsh.intel-email.com (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 3AB56DDA7AC for ; Mon, 15 Apr 2024 13:23:15 +0800 (CST) X-Received: from localhost (localhost [127.0.0.1]) by cxsh.intel-email.com (Postfix) with ESMTP id 35E0EDDA78D for ; Mon, 15 Apr 2024 13:23:15 +0800 (CST) X-Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by cxsh.intel-email.com (Postfix) with SMTP id 22ED0DDA787 for ; Mon, 15 Apr 2024 13:23:11 +0800 (CST) X-Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP(SSL) for ; Mon, 15 Apr 2024 13:23:05 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming via groups.io" To: "'Ni, Ray'" Cc: "'Huang, Jenny'" , "'Shih, More'" , , "'Lewandowski, Krzysztof'" , "'Cai, Xianglei'" , "'Lewandowski, Krzysztof'" References: <2ef49d5cd3593dc573f3fac9db533b4a93ef04b5.1710220024.git.xianglei.cai@intel.com> In-Reply-To: Subject: =?UTF-8?B?W2VkazItZGV2ZWxdIOWbnuWkjTogW1BBVENIIDEvMV0gTWRlTW9kdWxlUGtnL1hoY2lEeGU6IFJlc2V0IGVuZHBvaW50IHdoaWxlIFVTQiBUcmFuc2FjdGlvbiBlcnJvcg==?= Date: Mon, 15 Apr 2024 13:23:06 +0800 Message-ID: <00fc01da8ef4$ff8b61e0$fea225a0$@byosoft.com.cn> MIME-Version: 1.0 Thread-Index: AQI9SsNl3R3G6bbr8WVwYBBSIeW2HAEwbmQQAdj88CgCxca0AgIMzVvVsGRzagA= Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Sun, 14 Apr 2024 22:23:18 -0700 Resent-From: gaoliming@byosoft.com.cn Reply-To: devel@edk2.groups.io,gaoliming@byosoft.com.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: PPs8v8oypXA23Ok8On3yZT8jx7686176AA= Content-Type: multipart/alternative; boundary="----=_NextPart_000_00FD_01DA8F38.0DB112E0" Content-Language: zh-cn X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=j2thF96p; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.9 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=pass (policy=none) header.from=groups.io ------=_NextPart_000_00FD_01DA8F38.0DB112E0 Content-Type: text/plain; charset="gb2312" Content-Transfer-Encoding: quoted-printable Xianglei: Now, UEFI spec doesn=A1=AFt define EFI_USB_ERR_TRANSACTION. So, we can=A1= =AFt update UsbIo.h now.=20 =20 EFI_USB_ERR_TRANSACTION is only used in XhciDxe for error condition check= . I suggest to add comments for current code, don=A1=AFt need code update.=20 =20 Thanks Liming =B7=A2=BC=FE=C8=CB: Ni, Ray =20 =B7=A2=CB=CD=CA=B1=BC=E4: 2024=C4=EA4=D4=C215=C8=D5 10:17 =CA=D5=BC=FE=C8=CB: Liming Gao =B3=AD=CB=CD: Huang, Jenny ; Shih, More ; devel@edk2.groups.io; Lewandowski, Krzysztof ; Cai, Xianglei ; Lewandowski, Krzysztof =D6=F7=CC=E2: Re: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while US= B Transaction error =20 Liming, Can you give a R-B? =20 Thanks, Ray _____ =20 From: Cai, Xianglei > Sent: Friday, April 12, 2024 9:53 To: Lewandowski, Krzysztof >; devel@edk2.groups.io >; Ni, Ray >; Liming Gao > Cc: Huang, Jenny >; Shih, More > Subject: RE: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error=20 =20 @Ni, Ray @Liming GaoWould you like to merge the patch to upstream? =20 Thanks, Xianglei =20 From: Lewandowski, Krzysztof >=20 Sent: Thursday, April 11, 2024 9:45 PM To: devel@edk2.groups.io =20 Cc: Ni, Ray >; Liming Gao >; Huang, Jenny >; Shih, More >; Cai, Xianglei > Subject: Re: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error =20 Looks good to me. Reviewed-by: Krzysztof Lewandowski > _____ =20 From: Cai, Xianglei > Sent: Wednesday, April 10, 2024 09:02 To: devel@edk2.groups.io > Cc: Cai, Xianglei >= ; Ni, Ray >; Liming Gao >; Lewandowski, Krzysztof >; Huang, Jenny >; Shih, More > Subject: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error=20 =20 https://bugzilla.tianocore.org/show_bug.cgi?id=3D4556 Based on XHCI spec 4.8.3, software should do the reset endpoint while USB Transaction occur. Also add the error code for USB Transaction error since UEFI spec don't have the related definition. Cc: Ray Ni > Cc: Liming Gao > Cc: Krzysztof Lewandowski > Cc: Jenny Huang > Cc: More Shih > Signed-off-by: Xianglei Cai > --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +- MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c | 2 +- MdePkg/Include/Protocol/UsbIo.h | 21 +++++++++++---------- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c index f4e61d223c1b..63cc29b26536 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c @@ -825,7 +825,7 @@ XhcTransfer ( *TransferResult =3D Urb->Result; *DataLength =3D Urb->Completed; =20 - if ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || (*TransferResult =3D= =3D EFI_USB_ERR_BABBLE)) { + if ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || (*TransferResult =3D= =3D EFI_USB_ERR_BABBLE) || (*TransferResult =3D=3D EFI_USB_ERR_TRANSACTION)) { ASSERT (Status =3D=3D EFI_DEVICE_ERROR); RecoveryStatus =3D XhcRecoverHaltedEndpoint (Xhc, Urb); if (EFI_ERROR (RecoveryStatus)) { diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c index 05528a478baf..e77852f62f10 100644 --- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c +++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c @@ -1193,7 +1193,7 @@ XhcCheckUrbResult ( goto EXIT; =20 case TRB_COMPLETION_USB_TRANSACTION_ERROR: - CheckedUrb->Result |=3D EFI_USB_ERR_TIMEOUT; + CheckedUrb->Result |=3D EFI_USB_ERR_TRANSACTION; CheckedUrb->Finished =3D TRUE; DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: TRANSACTION_ERROR! Completecode =3D %x\n", EvtTrb->Completecode)); goto EXIT; diff --git a/MdePkg/Include/Protocol/UsbIo.h b/MdePkg/Include/Protocol/UsbIo.h index a780b4e07b44..211ef0c94156 100644 --- a/MdePkg/Include/Protocol/UsbIo.h +++ b/MdePkg/Include/Protocol/UsbIo.h @@ -50,16 +50,17 @@ typedef enum { // // USB Transfer Results // -#define EFI_USB_NOERROR 0x00 -#define EFI_USB_ERR_NOTEXECUTE 0x01 -#define EFI_USB_ERR_STALL 0x02 -#define EFI_USB_ERR_BUFFER 0x04 -#define EFI_USB_ERR_BABBLE 0x08 -#define EFI_USB_ERR_NAK 0x10 -#define EFI_USB_ERR_CRC 0x20 -#define EFI_USB_ERR_TIMEOUT 0x40 -#define EFI_USB_ERR_BITSTUFF 0x80 -#define EFI_USB_ERR_SYSTEM 0x100 +#define EFI_USB_NOERROR 0x00 +#define EFI_USB_ERR_NOTEXECUTE 0x01 +#define EFI_USB_ERR_STALL 0x02 +#define EFI_USB_ERR_BUFFER 0x04 +#define EFI_USB_ERR_BABBLE 0x08 +#define EFI_USB_ERR_NAK 0x10 +#define EFI_USB_ERR_CRC 0x20 +#define EFI_USB_ERR_TIMEOUT 0x40 +#define EFI_USB_ERR_BITSTUFF 0x80 +#define EFI_USB_ERR_SYSTEM 0x100 +#define EFI_USB_ERR_TRANSACTION 0x200 =20 /** Async USB transfer callback routine. --=20 2.42.0.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117749): https://edk2.groups.io/g/devel/message/117749 Mute This Topic: https://groups.io/mt/105530298/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- ------=_NextPart_000_00FD_01DA8F38.0DB112E0 Content-Type: text/html; charset="gb2312" Content-Transfer-Encoding: quoted-printable

Xianglei:

  Now, UEFI spec do= esn=A1=AFt define EFI_USB_ERR_TRANSACTION. So, we can=A1=AFt update UsbIo.h= now.

 

  EFI_USB_ERR_TRANSACTION is only used in XhciDxe for error c= ondition check. I suggest to add comments for current code, don=A1=AFt need= code update.

 

Thanks

Liming<= /span>

=B7=A2=BC=FE=C8=CB: Ni, Ray <ray.ni@intel.c= om>
=B7=A2=CB=CD=CA= =B1=BC=E4: 2024=C4= =EA4=D4=C215=C8=D5 10:17
=CA=D5=BC=FE=C8=CB:
Liming Gao <gaoliming@byosoft.com.cn>
=
=B3=AD=CB=CD: Hu= ang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.co= m>; devel@edk2.groups.io; Lewandowski, Krzysztof <krzysztof.lewandows= ki@intel.com>; Cai, Xianglei <xianglei.cai@intel.com>; Lewandowski= , Krzysztof <krzysztof.lewandowski@intel.com>
=D6=F7=CC= =E2: Re: [PATCH 1/1] MdeMo= dulePkg/XhciDxe: Reset endpoint while USB Transaction error

 = ;

Liming,

Can you give a R-B?

 

Thanks,

Ray


From: Cai, Xianglei <xianglei.cai@intel.com>
Sent: Friday, April 1= 2, 2024 9:53
To: Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; devel@edk2.groups.io <devel@edk2.groups.io>; Ni, Ray <ray.ni@intel.com>; Liming Gao <<= a href=3D"mailto:gaoliming@byosoft.com.cn">gaoliming@byosoft.com.cn>=
Cc: Huang, Jenny <je= nny.huang@intel.com>; Shih, More <more.shih@intel.com>
Subject: RE: [PATCH 1/1] MdeM= odulePkg/XhciDxe: Reset endpoint while USB Transaction error

 

@Ni, Ray @Liming GaoWould y= ou like to merge the patch to upstream?

 

Thanks,

Xianglei

 

From: Lewandowski, Krz= ysztof <krzysztof.lew= andowski@intel.com>
Sent: Thursday, April 11, 2024 9:45 P= M
To: devel@edk2.groups.i= o
Cc: Ni, Ray <ray.ni@= intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com>; Cai, Xianglei = <xianglei.cai@intel.com>= ;
Subject: Re: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint w= hile USB Transaction error

 

Looks good to me.

Reviewed-by: Krzysztof Lewandowski <krzysztof.lewandowski@intel.co= m>

=

F= rom: Cai, Xianglei <= xianglei.cai@intel.com>Sent: Wednesday, April 10, 2024 09:02
To: devel@edk2.groups.io <devel@edk2.groups.io>
Cc: Cai, Xianglei= <xianglei.cai@intel.com&g= t;; Ni, Ray <ray.ni@intel.com>= ;; Liming Gao <gaoliming@byo= soft.com.cn>; Lewandowski, Krzysztof <krzysztof.lewandowski@intel.com>; Huang, Jen= ny <jenny.huang@intel.com&g= t;; Shih, More <more.shih@intel.c= om>
Subject: [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpo= int while USB Transaction error

 =

https://bugzilla.tianocore.org/show_bug.cgi?id=3D4556
=
Based on XHCI spec 4.8.3, software should do the
reset endpoint whil= e USB Transaction occur.
Also add the error code for USB Transaction err= or
since UEFI spec don't have the related definition.

Cc: Ray Ni&= nbsp;           &nbs= p;            &= nbsp;      <ray.ni@intel.com>
Cc: Liming Gao     &n= bsp;            = ;          <gaoliming@byosoft.com.cn>
Cc: Krzysz= tof Lewandowski    <krzysztof.lewandowski@intel.com>
Cc: Jenny Huang&nb= sp;            =             &nb= sp; <jenny.huang@intel.com&= gt;
Cc: More Shih         &= nbsp;           &nbs= p;       <more.shih@intel.com>

Signed-off-by: Xianglei Cai <<= a href=3D"mailto:xianglei.cai@intel.com">xianglei.cai@intel.com>
= ---
 MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c    &nb= sp; |  2 +-
 MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c |  = 2 +-
 MdePkg/Include/Protocol/UsbIo.h     =      | 21 +++++++++++----------
 3 files change= d, 13 insertions(+), 12 deletions(-)

diff --git a/MdeModulePkg/Bus/P= ci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
index f4e61d223c= 1b..63cc29b26536 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
+++= b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
@@ -825,7 +825,7 @@ XhcTransfer (=
   *TransferResult =3D Urb->Result;
   *DataL= ength     =3D Urb->Completed;
 
-  i= f ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || (*TransferResult =3D=3D EF= I_USB_ERR_BABBLE)) {
+  if ((*TransferResult =3D=3D EFI_USB_ERR_STA= LL) || (*TransferResult =3D=3D EFI_USB_ERR_BABBLE) || (*TransferResult =3D= =3D EFI_USB_ERR_TRANSACTION)) {
     ASSERT (Status = =3D=3D EFI_DEVICE_ERROR);
     RecoveryStatus =3D Xh= cRecoverHaltedEndpoint (Xhc, Urb);
     if (EFI_ERRO= R (RecoveryStatus)) {
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSche= d.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 05528a478baf..e7785= 2f62f10 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/M= deModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -1193,7 +1193,7 @@ XhcCheckUr= bResult (
         goto EXIT; 
       case TRB_COMPLETION_USB_TRA= NSACTION_ERROR:
-        CheckedUrb-&= gt;Result  |=3D EFI_USB_ERR_TIMEOUT;
+     = ;   CheckedUrb->Result  |=3D EFI_USB_ERR_TRANSACTION;
=          CheckedUrb->Finished = =3D TRUE;
         DEBUG ((DEBUG= _ERROR, "XhcCheckUrbResult: TRANSACTION_ERROR! Completecode =3D %x\n&q= uot;, EvtTrb->Completecode));
      &nb= sp;  goto EXIT;
diff --git a/MdePkg/Include/Protocol/UsbIo.h b/MdeP= kg/Include/Protocol/UsbIo.h
index a780b4e07b44..211ef0c94156 100644
-= -- a/MdePkg/Include/Protocol/UsbIo.h
+++ b/MdePkg/Include/Protocol/UsbIo= .h
@@ -50,16 +50,17 @@ typedef enum {
 //
 // USB Transf= er Results
 //
-#define EFI_USB_NOERROR    &= nbsp;    0x00
-#define EFI_USB_ERR_NOTEXECUTE  0x01<= br>-#define EFI_USB_ERR_STALL       0x02
-= #define EFI_USB_ERR_BUFFER      0x04
-#define E= FI_USB_ERR_BABBLE      0x08
-#define EFI_USB_ER= R_NAK         0x10
-#define EFI_= USB_ERR_CRC         0x20
-#defin= e EFI_USB_ERR_TIMEOUT     0x40
-#define EFI_USB_ERR_= BITSTUFF    0x80
-#define EFI_USB_ERR_SYSTEM  &= nbsp;   0x100
+#define EFI_USB_NOERROR    =       0x00
+#define EFI_USB_ERR_NOTEXECUTE = ;  0x01
+#define EFI_USB_ERR_STALL     &nb= sp;  0x02
+#define EFI_USB_ERR_BUFFER     =   0x04
+#define EFI_USB_ERR_BABBLE     &nb= sp; 0x08
+#define EFI_USB_ERR_NAK      &nb= sp;   0x10
+#define EFI_USB_ERR_CRC    &nb= sp;     0x20
+#define EFI_USB_ERR_TIMEOUT  = ;    0x40
+#define EFI_USB_ERR_BITSTUFF   =   0x80
+#define EFI_USB_ERR_SYSTEM     &nb= sp; 0x100
+#define EFI_USB_ERR_TRANSACTION  0x200
 
&nbs= p;/**
   Async USB transfer callback routine.
--
2.42.0= .windows.2

=
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#117749) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
------=_NextPart_000_00FD_01DA8F38.0DB112E0--