From: "Xianglei Cai" <xianglei.cai@intel.com>
To: "devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Wu, Hao A" <hao.a.wu@intel.com>, "Ni, Ray" <ray.ni@intel.com>,
Liming Gao <gaoliming@byosoft.com.cn>,
"Huang, Jenny" <jenny.huang@intel.com>,
"Shih, More" <more.shih@intel.com>
Subject: Re: [edk2-devel] [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error
Date: Wed, 20 Mar 2024 08:22:20 +0000 [thread overview]
Message-ID: <MN0PR11MB603451BFFBAAA9003E58F62493332@MN0PR11MB6034.namprd11.prod.outlook.com> (raw)
In-Reply-To: <2ef49d5cd3593dc573f3fac9db533b4a93ef04b5.1710220024.git.xianglei.cai@intel.com>
Hi All,
Could you help review this change? Very Appreciate.
Best regards,
Xianglei
-----Original Message-----
From: Cai, Xianglei <xianglei.cai@intel.com>
Sent: Tuesday, March 12, 2024 1:13 PM
To: devel@edk2.groups.io
Cc: Cai, Xianglei <xianglei.cai@intel.com>; Wu, Hao A <hao.a.wu@intel.com>; Ni, Ray <ray.ni@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Huang, Jenny <jenny.huang@intel.com>; Shih, More <more.shih@intel.com>
Subject: [PATCH 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.
Also add the error code for USB Transaction error since UEFI spec don't have the related definition.
Cc: Hao A Wu <hao.a.wu@intel.com>
Cc: Ray Ni <ray.ni@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Jenny Huang <jenny.huang@intel.com>
Cc: More Shih <more.shih@intel.com>
Signed-off-by: Xianglei Cai <xianglei.cai@intel.com>
---
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 = Urb->Result;
*DataLength = Urb->Completed;
- if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) {
+ if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult ==
+ EFI_USB_ERR_BABBLE) || (*TransferResult == EFI_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 05528a478baf..e77852f62f10 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -1193,7 +1193,7 @@ XhcCheckUrbResult (
goto EXIT;
case TRB_COMPLETION_USB_TRANSACTION_ERROR:
- CheckedUrb->Result |= EFI_USB_ERR_TIMEOUT;
+ CheckedUrb->Result |= EFI_USB_ERR_TRANSACTION;
CheckedUrb->Finished = TRUE;
DEBUG ((DEBUG_ERROR, "XhcCheckUrbResult: TRANSACTION_ERROR! Completecode = %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
/**
Async USB transfer callback routine.
--
2.42.0.windows.2
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116914): https://edk2.groups.io/g/devel/message/116914
Mute This Topic: https://groups.io/mt/104879589/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-03-20 8:22 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1710220024.git.xianglei.cai@intel.com>
2024-03-12 5:13 ` [edk2-devel] [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Xianglei Cai
2024-03-20 8:22 ` Xianglei Cai [this message]
2024-04-11 13:44 ` Lewandowski, Krzysztof
2024-04-12 1:53 ` Xianglei Cai
2024-04-15 2:16 ` Ni, Ray
2024-04-15 5:23 ` [edk2-devel] 回复: " gaoliming via groups.io
2024-04-15 5:27 ` [edk2-devel] " Xianglei Cai
2024-04-15 6:35 ` [edk2-devel] 回复: " gaoliming via groups.io
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=MN0PR11MB603451BFFBAAA9003E58F62493332@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