From nobody Sat Jul 12 05:34:13 2025 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1500953220969101.66473894094133; Mon, 24 Jul 2017 20:27:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17C4121D28FEE; Mon, 24 Jul 2017 20:24:57 -0700 (PDT) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) (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 7A09F21D28FE6 for ; Mon, 24 Jul 2017 20:24:55 -0700 (PDT) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2017 20:26:42 -0700 Received: from shwdeopenpsi068.ccr.corp.intel.com ([10.239.9.12]) by orsmga001.jf.intel.com with ESMTP; 24 Jul 2017 20:26:40 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,409,1496127600"; d="scan'208";a="1154981313" From: Star Zeng To: edk2-devel@lists.01.org Date: Tue, 25 Jul 2017 11:26:33 +0800 Message-Id: <1500953193-317240-1-git-send-email-star.zeng@intel.com> X-Mailer: git-send-email 2.7.0.windows.1 Subject: [edk2] [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: , Cc: Ruiyu Ni , Vladimir Olovyannikov , Star Zeng MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D644 According to XHCI spec: 4.10.2.1 Stall Error 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 set the Babble Detected Error in the Completion Code field of the TRB, generate an Error Event, and halt the endpoint (refer to Section 4.10.2.1). This patch is to also check for EFI_USB_ERR_BABBLE error returned as a TransferResult and then proceed to XhcRecoverhaltedEndPoint. Cc: Vladimir Olovyannikov Cc: Ruiyu Ni Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng Reviewed-by: Ruiyu Ni --- MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c | 2 +- MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c b/MdeModulePkg/Bus/Pci/Xhc= iDxe/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 gPeiUsbControllerPp= iGuid 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) || (*TransferRes= ult =3D=3D EFI_USB_ERR_BABBLE)) { RecoveryStatus =3D XhcPeiRecoverHaltedEndpoint(Xhc, Urb); if (EFI_ERROR (RecoveryStatus)) { DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: XhcPeiRecoverHaltedEn= dpoint 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) || (*TransferRes= ult =3D=3D EFI_USB_ERR_BABBLE)) { RecoveryStatus =3D XhcPeiRecoverHaltedEndpoint(Xhc, Urb); if (EFI_ERROR (RecoveryStatus)) { DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: XhcPeiRecoverHaltedEndpo= int failed\n")); --=20 2.7.0.windows.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel