summaryrefslogtreecommitdiffstats
path: root/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
diff options
context:
space:
mode:
authorerictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-04 01:26:40 +0000
committererictian <erictian@6f19259b-4bc3-4df7-8a09-765794883524>2011-03-04 01:26:40 +0000
commit17a6c337d2a5fefd42feb83049e7dfa1b852822c (patch)
tree343571ecf3f2627d65de5153d379fbc90a67d4bd /MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
parent6617d838fa77334dd423e71561dd5e0a69025599 (diff)
downloadedk2-17a6c337d2a5fefd42feb83049e7dfa1b852822c.tar.gz
edk2-17a6c337d2a5fefd42feb83049e7dfa1b852822c.tar.bz2
edk2-17a6c337d2a5fefd42feb83049e7dfa1b852822c.zip
when timeout is 0, infinite loop on the timeout request to follow UEFI spec
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11343 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c')
-rw-r--r--MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
index 27d336a1cd..4dc8e1abf1 100644
--- a/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
+++ b/MdeModulePkg/Bus/Pci/EhciDxe/EhciSched.c
@@ -2,7 +2,7 @@
EHCI transfer scheduling routines.
-Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -691,12 +691,23 @@ EhcExecTransfer (
UINTN Index;
UINTN Loop;
BOOLEAN Finished;
+ BOOLEAN InfiniteLoop;
- Status = EFI_SUCCESS;
- Loop = (TimeOut * EHC_1_MILLISECOND / EHC_SYNC_POLL_INTERVAL) + 1;
- Finished = FALSE;
+ Status = EFI_SUCCESS;
+ Loop = (TimeOut * EHC_1_MILLISECOND / EHC_SYNC_POLL_INTERVAL) + 1;
+ Finished = FALSE;
+ InfiniteLoop = FALSE;
- for (Index = 0; Index < Loop; Index++) {
+ //
+ // According to UEFI spec section 16.2.4, If Timeout is 0, then the caller
+ // must wait for the function to be completed until EFI_SUCCESS or EFI_DEVICE_ERROR
+ // is returned.
+ //
+ if (TimeOut == 0) {
+ InfiniteLoop = TRUE;
+ }
+
+ for (Index = 0; InfiniteLoop || (Index < Loop); Index++) {
Finished = EhcCheckUrbResult (Ehc, Urb);
if (Finished) {