Author: fireball
Date: Mon Nov 2 21:12:19 2009
New Revision: 43920
URL:
http://svn.reactos.org/svn/reactos?rev=43920&view=rev
Log:
[uniata]
- Don't wait so long for drive reset. Reapplying r26470 by Dmitriy Gorbachev.
Modified:
trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp
Modified: trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/storage/ide/uniata…
==============================================================================
--- trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] (original)
+++ trunk/reactos/drivers/storage/ide/uniata/id_ata.cpp [iso-8859-1] Mon Nov 2 21:12:19
2009
@@ -679,7 +679,7 @@
)
{
//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 @@
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);