]> git.proxmox.com Git - mirror_edk2.git/commitdiff
MdeModulePkg Xhci: Also RecoverHaltedEndpoint for BABBLE_ERROR
authorStar Zeng <star.zeng@intel.com>
Tue, 25 Jul 2017 03:24:01 +0000 (11:24 +0800)
committerStar Zeng <star.zeng@intel.com>
Wed, 26 Jul 2017 08:06:19 +0000 (16:06 +0800)
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=644

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 <vladimir.olovyannikov@broadcom.com>
Cc: Ruiyu Ni <ruiyu.ni@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
MdeModulePkg/Bus/Pci/XhciDxe/Xhci.c
MdeModulePkg/Bus/Pci/XhciPei/XhcPeim.c

index 20ad3f1611979ff187abb7fb47c0ed800be32fa8..c884f4c3146c1977b2e154013d9b3fcc5a4aa209 100644 (file)
@@ -801,7 +801,7 @@ XhcTransfer (
   *TransferResult = Urb->Result;\r
   *DataLength     = Urb->Completed;\r
 \r
   *TransferResult = Urb->Result;\r
   *DataLength     = Urb->Completed;\r
 \r
-  if (*TransferResult == EFI_USB_ERR_STALL) {\r
+  if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) {\r
     ASSERT (Status == EFI_DEVICE_ERROR);\r
     RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb);\r
     if (EFI_ERROR (RecoveryStatus)) {\r
     ASSERT (Status == EFI_DEVICE_ERROR);\r
     RecoveryStatus = XhcRecoverHaltedEndpoint(Xhc, Urb);\r
     if (EFI_ERROR (RecoveryStatus)) {\r
index 57e70701e826dbea37357c41f62aeeb86bfe1241..38f0d2184cff71e3ec7739c9e8e7d7ed910c5c07 100644 (file)
@@ -2,7 +2,7 @@
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
 PEIM to produce gPeiUsb2HostControllerPpiGuid based on gPeiUsbControllerPpiGuid\r
 which is used to enable recovery function from USB Drivers.\r
 \r
-Copyright (c) 2014 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2014 - 2017, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -666,7 +666,7 @@ XhcPeiControlTransfer (
   } else {\r
     if (*TransferResult == EFI_USB_NOERROR) {\r
       Status = EFI_SUCCESS;\r
   } else {\r
     if (*TransferResult == EFI_USB_NOERROR) {\r
       Status = EFI_SUCCESS;\r
-    } else if (*TransferResult == EFI_USB_ERR_STALL) {\r
+    } else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) {\r
       RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);\r
       if (EFI_ERROR (RecoveryStatus)) {\r
         DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: XhcPeiRecoverHaltedEndpoint failed\n"));\r
       RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);\r
       if (EFI_ERROR (RecoveryStatus)) {\r
         DEBUG ((EFI_D_ERROR, "XhcPeiControlTransfer: XhcPeiRecoverHaltedEndpoint failed\n"));\r
@@ -988,7 +988,7 @@ XhcPeiBulkTransfer (
   } else {\r
     if (*TransferResult == EFI_USB_NOERROR) {\r
       Status = EFI_SUCCESS;\r
   } else {\r
     if (*TransferResult == EFI_USB_NOERROR) {\r
       Status = EFI_SUCCESS;\r
-    } else if (*TransferResult == EFI_USB_ERR_STALL) {\r
+    } else if ((*TransferResult == EFI_USB_ERR_STALL) || (*TransferResult == EFI_USB_ERR_BABBLE)) {\r
       RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);\r
       if (EFI_ERROR (RecoveryStatus)) {\r
         DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: XhcPeiRecoverHaltedEndpoint failed\n"));\r
       RecoveryStatus = XhcPeiRecoverHaltedEndpoint(Xhc, Urb);\r
       if (EFI_ERROR (RecoveryStatus)) {\r
         DEBUG ((EFI_D_ERROR, "XhcPeiBulkTransfer: XhcPeiRecoverHaltedEndpoint failed\n"));\r