summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
diff options
context:
space:
mode:
Diffstat (limited to 'MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c')
-rw-r--r--MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
index a3b9ccd484..12a40d413e 100644
--- a/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
+++ b/MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.c
@@ -1339,7 +1339,12 @@ AtaPassThruPassThru (
Task->Packet = Packet;
Task->Event = Event;
Task->IsStart = FALSE;
- Task->RetryTimes = 0;
+ Task->RetryTimes = DivU64x32(Packet->Timeout, 1000) + 1;
+ if (Packet->Timeout == 0) {
+ Task->InfiniteWait = TRUE;
+ } else {
+ Task->InfiniteWait = FALSE;
+ }
OldTpl = gBS->RaiseTPL (TPL_NOTIFY);
InsertTailList (&Instance->NonBlockingTaskList, &Task->Link);