summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2015-07-08 05:54:21 +0000
committererictian <erictian@Edk2>2015-07-08 05:54:21 +0000
commita40a5c08bee12f7346268dcabde4807435dbb4c3 (patch)
tree25a0626d0cf3ea1f7206694d7ccaa9ff198d8028
parent6a46c1a2a62135d8f55d093f08bc06537b3ba8ef (diff)
downloadedk2-platforms-a40a5c08bee12f7346268dcabde4807435dbb4c3.tar.xz
MdeModulePkg/XhciDxe: Error handling enhancement for XhcExecTransfer
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Baraneedharan Anbazhagan <anbazhagan@hp.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17879 6f19259b-4bc3-4df7-8a09-765794883524
-rw-r--r--MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
index 8ff194ea9b..1bdf1a4aa0 100644
--- a/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciDxe/XhciSched.c
@@ -1027,7 +1027,7 @@ IsTransferRingTrb (
@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 @@ XhcCheckUrbResult (
if (XhcIsHalt (Xhc) || XhcIsSysError (Xhc)) {
Urb->Result |= EFI_USB_ERR_SYSTEM;
- Status = EFI_DEVICE_ERROR;
goto EXIT;
}
@@ -1189,7 +1188,7 @@ EXIT:
XhcWriteRuntimeReg (Xhc, XHC_ERDP_OFFSET + 4, XHC_HIGH_32BIT (PhyAddr));
}
- return Status;
+ return Urb->Finished;
}
@@ -1219,6 +1218,7 @@ XhcExecTransfer (
UINTN Loop;
UINT8 SlotId;
UINT8 Dci;
+ BOOLEAN Finished;
if (CmdTransfer) {
SlotId = 0;
@@ -1241,8 +1241,8 @@ XhcExecTransfer (
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 @@ XhcExecTransfer (
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;