- Don't wait so long for drive reset. Reapplying r26470 by Dmitriy Gorbachev.

svn path=/trunk/; revision=43920
This commit is contained in:
Aleksey Bragin 2009-11-02 20:12:19 +00:00
parent 9d9af14d23
commit 451776ec01

View file

@ -679,7 +679,7 @@ AtapiSoftReset(
) )
{ {
//ULONG c = chan->lChannel; //ULONG c = chan->lChannel;
ULONG i; ULONG i = 1000 * 1000;
UCHAR dma_status = 0; UCHAR dma_status = 0;
KdPrint2((PRINT_PREFIX "AtapiSoftReset:\n")); KdPrint2((PRINT_PREFIX "AtapiSoftReset:\n"));
UCHAR statusByte2; UCHAR statusByte2;
@ -689,8 +689,10 @@ AtapiSoftReset(
SelectDrive(chan, DeviceNumber); SelectDrive(chan, DeviceNumber);
AtapiStallExecution(10000); AtapiStallExecution(10000);
AtapiWritePort1(chan, IDX_IO1_o_Command, IDE_COMMAND_ATAPI_RESET); AtapiWritePort1(chan, IDX_IO1_o_Command, IDE_COMMAND_ATAPI_RESET);
for (i = 0; i < 1000; i++) { while ((AtapiReadPort1(chan, IDX_IO1_i_Status) & IDE_STATUS_BUSY) &&
AtapiStallExecution(999); i--)
{
AtapiStallExecution(30);
} }
SelectDrive(chan, DeviceNumber); SelectDrive(chan, DeviceNumber);
WaitOnBusy(chan); WaitOnBusy(chan);