Fix for ticket #4543. This fixes the ATA
timeout waiting for interrupt / device busy / status 0x58 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33626 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
6886b5bf6a
commit
2ca5f51b08
@ -531,9 +531,6 @@ ATAChannel::PrepareWaitingForInterrupt()
|
||||
InterruptsSpinLocker locker(fInterruptLock);
|
||||
fExpectsInterrupt = true;
|
||||
fInterruptCondition.Add(&fInterruptConditionEntry);
|
||||
|
||||
// enable interrupts
|
||||
_WriteControl(0);
|
||||
}
|
||||
|
||||
|
||||
@ -590,15 +587,20 @@ ATAChannel::SendRequest(ATARequest *request, uint32 flags)
|
||||
|
||||
TRACE("SendRequest status 0x%02x\n", AltStatus());
|
||||
|
||||
if (request->UseDMA())
|
||||
_WriteControl(0); // enable interrupts
|
||||
|
||||
if (device->Select() != B_OK) {
|
||||
TRACE_ERROR("device selection failed\n");
|
||||
request->SetStatus(SCSI_SEL_TIMEOUT);
|
||||
_WriteControl(ATA_DEVICE_CONTROL_DISABLE_INTS);
|
||||
return B_TIMED_OUT;
|
||||
}
|
||||
|
||||
if (WaitForIdle() != B_OK) {
|
||||
TRACE_ERROR("device selection timeout\n");
|
||||
request->SetStatus(SCSI_SEL_TIMEOUT);
|
||||
_WriteControl(ATA_DEVICE_CONTROL_DISABLE_INTS);
|
||||
return B_TIMED_OUT;
|
||||
}
|
||||
|
||||
@ -606,6 +608,7 @@ ATAChannel::SendRequest(ATARequest *request, uint32 flags)
|
||||
&& (AltStatus() & ATA_STATUS_DEVICE_READY) == 0) {
|
||||
TRACE_ERROR("device ready not set\n");
|
||||
request->SetStatus(SCSI_SEQUENCE_FAIL);
|
||||
_WriteControl(ATA_DEVICE_CONTROL_DISABLE_INTS);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
@ -613,6 +616,7 @@ ATAChannel::SendRequest(ATARequest *request, uint32 flags)
|
||||
| ATA_MASK_COMMAND) != B_OK) {
|
||||
TRACE_ERROR("can't write command\n");
|
||||
request->SetStatus(SCSI_HBA_ERR);
|
||||
_WriteControl(ATA_DEVICE_CONTROL_DISABLE_INTS);
|
||||
return B_ERROR;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user