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
This commit is contained in:
Feng Tian 2015-07-08 05:54:44 +00:00 committed by erictian
parent a40a5c08be
commit 56b1927aa1
1 changed files with 8 additions and 5 deletions

View File

@ -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;