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

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/XhciPei/XhciSched.c

Modified: trunk/edk2/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
===================================================================
--- trunk/edk2/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c 2015-07-08 05:54:21 UTC 
(rev 17879)
+++ trunk/edk2/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c 2015-07-08 05:54:44 UTC 
(rev 17880)
@@ -553,7 +553,7 @@
   @return Whether the result of URB transfer is finialized.
 
 **/
-EFI_STATUS
+BOOLEAN
 XhcPeiCheckUrbResult (
   IN PEI_XHC_DEV            *Xhc,
   IN URB                    *Urb
@@ -582,7 +582,6 @@
 
   if (XhcPeiIsHalt (Xhc) || XhcPeiIsSysError (Xhc)) {
     Urb->Result |= EFI_USB_ERR_SYSTEM;
-    Status       = EFI_DEVICE_ERROR;
     goto EXIT;
   }
 
@@ -711,7 +710,7 @@
     XhcPeiWriteRuntimeReg (Xhc, XHC_ERDP_OFFSET + 4, XHC_HIGH_32BIT (PhyAddr));
   }
 
-  return Status;
+  return Urb->Finished;
 }
 
 /**
@@ -740,6 +739,7 @@
   UINTN         Loop;
   UINT8         SlotId;
   UINT8         Dci;
+  BOOLEAN       Finished;
 
   if (CmdTransfer) {
     SlotId = 0;
@@ -761,8 +761,8 @@
   XhcPeiRingDoorBell (Xhc, SlotId, Dci);
 
   for (Index = 0; Index < Loop; Index++) {
-    Status = XhcPeiCheckUrbResult (Xhc, Urb);
-    if (Urb->Finished) {
+    Finished = XhcPeiCheckUrbResult (Xhc, Urb);
+    if (Finished) {
       break;
     }
     MicroSecondDelay (XHC_1_MICROSECOND);
@@ -770,6 +770,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