summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus
diff options
context:
space:
mode:
authorFeng Tian <feng.tian@intel.com>2015-07-08 05:54:44 +0000
committererictian <erictian@Edk2>2015-07-08 05:54:44 +0000
commit56b1927aa107e65070879a53562b7bcdc1e918d8 (patch)
treef9f420e76f65301be3b58cb200e43c4ea56ef985 /MdeModulePkg/Bus
parenta40a5c08bee12f7346268dcabde4807435dbb4c3 (diff)
downloadedk2-56b1927aa107e65070879a53562b7bcdc1e918d8.zip
edk2-56b1927aa107e65070879a53562b7bcdc1e918d8.tar.gz
edk2-56b1927aa107e65070879a53562b7bcdc1e918d8.tar.bz2
MdeModulePkg/XhciPei: Error handling enhancement for XhcPeiExecTransfer
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@17880 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus')
-rw-r--r--MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
index 14a5c0e..0f35517 100644
--- a/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
+++ b/MdeModulePkg/Bus/Pci/XhciPei/XhciSched.c
@@ -553,7 +553,7 @@ XhcPeiIsTransferRingTrb (
@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 @@ XhcPeiCheckUrbResult (
if (XhcPeiIsHalt (Xhc) || XhcPeiIsSysError (Xhc)) {
Urb->Result |= EFI_USB_ERR_SYSTEM;
- Status = EFI_DEVICE_ERROR;
goto EXIT;
}
@@ -711,7 +710,7 @@ EXIT:
XhcPeiWriteRuntimeReg (Xhc, XHC_ERDP_OFFSET + 4, XHC_HIGH_32BIT (PhyAddr));
}
- return Status;
+ return Urb->Finished;
}
/**
@@ -740,6 +739,7 @@ XhcPeiExecTransfer (
UINTN Loop;
UINT8 SlotId;
UINT8 Dci;
+ BOOLEAN Finished;
if (CmdTransfer) {
SlotId = 0;
@@ -761,8 +761,8 @@ XhcPeiExecTransfer (
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 @@ XhcPeiExecTransfer (
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;