From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 7CAD921D28FE6 for ; Mon, 24 Jul 2017 20:26:25 -0700 (PDT) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2017 20:28:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,409,1496127600"; d="scan'208";a="115219815" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga002.jf.intel.com with ESMTP; 24 Jul 2017 20:28:26 -0700 Received: from fmsmsx124.amr.corp.intel.com (10.18.125.39) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Jul 2017 20:28:25 -0700 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by fmsmsx124.amr.corp.intel.com (10.18.125.39) with Microsoft SMTP Server (TLS) id 14.3.319.2; Mon, 24 Jul 2017 20:28:25 -0700 Received: from shsmsx104.ccr.corp.intel.com ([169.254.5.151]) by shsmsx102.ccr.corp.intel.com ([169.254.2.146]) with mapi id 14.03.0319.002; Tue, 25 Jul 2017 11:28:21 +0800 From: "Ni, Ruiyu" To: "Zeng, Star" , "edk2-devel@lists.01.org" CC: Vladimir Olovyannikov Thread-Topic: [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR Thread-Index: AQHTBPXaIZdHMeJnWk+J3gFNVS/qQ6Jj4hRQ Date: Tue, 25 Jul 2017 03:28:21 +0000 Deferred-Delivery: Tue, 25 Jul 2017 03:28:00 +0000 Message-ID: <734D49CCEBEEF84792F5B80ED585239D5B9BFC02@SHSMSX104.ccr.corp.intel.com> References: <1500953193-317240-1-git-send-email-star.zeng@intel.com> In-Reply-To: <1500953193-317240-1-git-send-email-star.zeng@intel.com> Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jul 2017 03:26:25 -0000 Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Reviewed-by: Ruiyu Ni Thanks/Ray > -----Original Message----- > From: Zeng, Star > Sent: Tuesday, July 25, 2017 11:27 AM > To: edk2-devel@lists.01.org > Cc: Zeng, Star ; Vladimir Olovyannikov > ; Ni, Ruiyu > Subject: [PATCH] MdeModulePkg Xhci: Also RecoverHaltedEndpoint for > BABBLE_ERROR >=20 > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D644 >=20 > According to XHCI spec: > 4.10.2.1 Stall Error >=20 > 4.10.2.4 Babble Detected Error > When a device transmits more data on the USB than the host controller is > expecting for a transaction, it is defined to be babbling. > In general, this is called a Babble Error. When a device sends more data = than > the TD Transfer Size bytes (TD Babble), unexpected activity that persists > beyond a specified point in a (micro)frame (Frame Babble), or a packet > greater than Max Packet Size (Packet Babble), the host controller shall s= et > the Babble Detected Error in the Completion Code field of the TRB, genera= te > an Error Event, and halt the endpoint (refer to Section 4.10.2.1). >=20 > This patch is to also check for EFI_USB_ERR_BABBLE error returned as a > TransferResult and then proceed to XhcRecoverhaltedEndPoint. >=20 > Cc: Vladimir Olovyannikov > Cc: Ruiyu Ni > Contributed-under: TianoCore Contribution Agreement 1.0 > Signed-off-by: Star Zeng > --- > MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +- > MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 6 +++--- > 2 files changed, 4 insertions(+), 4 deletions(-) >=20 > diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > index 20ad3f161197..c884f4c3146c 100644 > --- a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > +++ b/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c > @@ -801,7 +801,7 @@ XhcTransfer ( > *TransferResult =3D Urb->Result; > *DataLength =3D Urb->Completed; >=20 > - if (*TransferResult =3D=3D EFI_USB_ERR_STALL) { > + if ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || (*TransferResult =3D= =3D > + EFI_USB_ERR_BABBLE)) { > ASSERT (Status =3D=3D EFI_DEVICE_ERROR); > RecoveryStatus =3D XhcRecoverHaltedEndpoint(Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { > diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c > b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c > index 57e70701e826..38f0d2184cff 100644 > --- a/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c > +++ b/MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c > @@ -2,7 +2,7 @@ > PEIM to produce gPeiUsb2HostControllerPpiGuid based on > gPeiUsbControllerPpiGuid which is used to enable recovery function from > USB Drivers. >=20 > -Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.
> +Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.
>=20 > This program and the accompanying materials are licensed and made > available under the terms and conditions @@ -666,7 +666,7 @@ > XhcPeiControlTransfer ( > } else { > if (*TransferResult =3D=3D EFI_USB_NOERROR) { > Status =3D EFI_SUCCESS; > - } else if (*TransferResult =3D=3D EFI_USB_ERR_STALL) { > + } else if ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || > + (*TransferResult =3D=3D EFI_USB_ERR_BABBLE)) { > RecoveryStatus =3D XhcPeiRecoverHaltedEndpoint(Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { > DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: > XhcPeiRecoverHaltedEndpoint failed\n")); @@ -988,7 +988,7 @@ > XhcPeiBulkTransfer ( > } else { > if (*TransferResult =3D=3D EFI_USB_NOERROR) { > Status =3D EFI_SUCCESS; > - } else if (*TransferResult =3D=3D EFI_USB_ERR_STALL) { > + } else if ((*TransferResult =3D=3D EFI_USB_ERR_STALL) || > + (*TransferResult =3D=3D EFI_USB_ERR_BABBLE)) { > RecoveryStatus =3D XhcPeiRecoverHaltedEndpoint(Xhc, Urb); > if (EFI_ERROR (RecoveryStatus)) { > DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: > XhcPeiRecoverHaltedEndpoint failed\n")); > -- > 2.7.0.windows.1