diff --git a/reactos/drivers/storage/ide/uniata/id_ata.cpp b/reactos/drivers/storage/ide/uniata/id_ata.cpp index b3f8eb1daf1..4f8571b76d7 100644 --- a/reactos/drivers/storage/ide/uniata/id_ata.cpp +++ b/reactos/drivers/storage/ide/uniata/id_ata.cpp @@ -679,7 +679,7 @@ AtapiSoftReset( ) { //ULONG c = chan->lChannel; - ULONG i; + ULONG i = 1000 * 1000; UCHAR dma_status = 0; KdPrint2((PRINT_PREFIX "AtapiSoftReset:\n")); UCHAR statusByte2; @@ -689,8 +689,10 @@ AtapiSoftReset( SelectDrive(chan, DeviceNumber); AtapiStallExecution(10000); AtapiWritePort1(chan, IDX_IO1_o_Command, IDE_COMMAND_ATAPI_RESET); - for (i = 0; i < 1000; i++) { - AtapiStallExecution(999); + while ((AtapiReadPort1(chan, IDX_IO1_i_Status) & IDE_STATUS_BUSY) && + i--) + { + AtapiStallExecution(30); } SelectDrive(chan, DeviceNumber); WaitOnBusy(chan);