Revision: 17879
          http://sourceforge.net/p/edk2/code/17879
Author:   erictian
Date:     2015-07-08 05:54:21 +0000 (Wed, 08 Jul 2015)
Log Message:
-----------
MdeModulePkg/XhciDxe: Error handling enhancement for XhcExecTransfer

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Feng Tian <[email protected]>
Reviewed-by: Baraneedharan Anbazhagan <[email protected]>

Modified Paths:
--------------
    trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c 2015-07-08 05:49:07 UTC 
(rev 17878)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c 2015-07-08 05:54:21 UTC 
(rev 17879)
@@ -1027,7 +1027,7 @@
   @return Whether the result of URB transfer is finialized.
 
 **/
-EFI_STATUS
+BOOLEAN
 XhcCheckUrbResult (
   IN  USB_XHCI_INSTANCE   *Xhc,
   IN  URB                 *Urb
@@ -1058,7 +1058,6 @@
 
   if (XhcIsHalt (Xhc) || XhcIsSysError (Xhc)) {
     Urb->Result |= EFI_USB_ERR_SYSTEM;
-    Status       = EFI_DEVICE_ERROR;
     goto EXIT;
   }
 
@@ -1189,7 +1188,7 @@
     XhcWriteRuntimeReg (Xhc, XHC_ERDP_OFFSET + 4, XHC_HIGH_32BIT (PhyAddr));
   }
 
-  return Status;
+  return Urb->Finished;
 }
 
 
@@ -1219,6 +1218,7 @@
   UINTN                   Loop;
   UINT8                   SlotId;
   UINT8                   Dci;
+  BOOLEAN                 Finished;
 
   if (CmdTransfer) {
     SlotId = 0;
@@ -1241,8 +1241,8 @@
   XhcRingDoorBell (Xhc, SlotId, Dci);
 
   for (Index = 0; Index < Loop; Index++) {
-    Status = XhcCheckUrbResult (Xhc, Urb);
-    if (Urb->Finished) {
+    Finished = XhcCheckUrbResult (Xhc, Urb);
+    if (Finished) {
       break;
     }
     gBS->Stall (XHC_1_MICROSECOND);
@@ -1250,6 +1250,9 @@
 
   if (Index == Loop) {
     Urb->Result = EFI_USB_ERR_TIMEOUT;
+    Status      = EFI_TIMEOUT;
+  } else if (Urb->Result != EFI_USB_NOERROR) {
+    Status      = EFI_DEVICE_ERROR;
   }
 
   return Status;


------------------------------------------------------------------------------
Don't Limit Your Business. Reach for the Cloud.
GigeNET's Cloud Solutions provide you with the tools and support that
you need to offload your IT needs and focus on growing your business.
Configured For All Businesses. Start Your Cloud Today.
https://www.gigenetcloud.com/
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to