From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 05D8BAC0AD3 for ; Tue, 12 Mar 2024 05:13:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=EEWoZU6tssy4kdbgONBYTKrYwLkLXpam1opzrFpmD3Q=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710220403; v=1; b=sDqLJ/fT9cjs3b9GNguDezkTdmmuA2EzwDBdjC95t0edsVrsKnQS/MwHFPrQSH5AmIUmUiob +D/HvquDbmfLHfKIWpiUeNS5TVjTCyFaHnWetBgHtA5PXwW50Q59rFucF2Hl/1JcxOv0nu2Qtlv MBvgJy7GzpLmFzYers5qMyKK4HDJfEnjJH2XsKHVzodkMIzmFdxn+8k0HjC6bgWVZ5RfKOLYM4W ozZ6sTDfdasYe/rveGfO1eZDJUWhujPb0yrL43iWgMSdV0dN6N8/t7h8dSC7raUrudSRXPkNxZs oOV8rj+xfT6NRNtD60/WDNn8KqoUj3M7e13kHSckkXmwQ== X-Received: by 127.0.0.2 with SMTP id 98sEYY7687511xzi1gJo1pZQ; Mon, 11 Mar 2024 22:13:23 -0700 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.16]) by mx.groups.io with SMTP id smtpd.web11.1836.1710220402806642844 for ; Mon, 11 Mar 2024 22:13:22 -0700 X-IronPort-AV: E=McAfee;i="6600,9927,11010"; a="5518124" X-IronPort-AV: E=Sophos;i="6.07,118,1708416000"; d="scan'208";a="5518124" X-Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by fmvoesa110.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2024 22:13:23 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,118,1708416000"; d="scan'208";a="11334829" X-Received: from shclientbuild02.ccr.corp.intel.com ([10.239.133.21]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Mar 2024 22:13:20 -0700 From: "Xianglei Cai" To: devel@edk2.groups.io Cc: Xianglei Cai , Hao A Wu , Ray Ni , Liming Gao , Jenny Huang , More Shih Subject: [edk2-devel] [PATCH 1/1] MdeModulePkg/XhciDxe: Reset endpoint while USB Transaction error Date: Tue, 12 Mar 2024 13:13:01 +0800 Message-ID: <2ef49d5cd3593dc573f3fac9db533b4a93ef04b5.1710220024.git.xianglei.cai@intel.com> In-Reply-To: References: MIME-Version: 1.0 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: Mon, 11 Mar 2024 22:13:23 -0700 Reply-To: devel@edk2.groups.io,xianglei.cai@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: dBMxphkHm6GvjNXtdzkZASdDx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b="sDqLJ/fT"; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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 Cc: Ray Ni Cc: Liming Gao 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 = 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 (#116666): https://edk2.groups.io/g/devel/message/116666 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] -=-=-=-=-=-=-=-=-=-=-=-