Clear pending interrupts after reset and timeouts
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33039 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -405,6 +405,9 @@ ATAChannel::Reset()
|
|||||||
|
|
||||||
_FlushAndWait(150 * 1000);
|
_FlushAndWait(150 * 1000);
|
||||||
|
|
||||||
|
// read status to clear any pending interrupts
|
||||||
|
_Status();
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -564,7 +567,8 @@ ATAChannel::WaitForInterrupt(bigtime_t timeout)
|
|||||||
status_t
|
status_t
|
||||||
ATAChannel::RecoverLostInterrupt()
|
ATAChannel::RecoverLostInterrupt()
|
||||||
{
|
{
|
||||||
uint8 status = AltStatus();
|
// read status to clear any pending interrupts
|
||||||
|
uint8 status = _Status();
|
||||||
if (status & (ATA_STATUS_BUSY | ATA_STATUS_DATA_REQUEST)) {
|
if (status & (ATA_STATUS_BUSY | ATA_STATUS_DATA_REQUEST)) {
|
||||||
TRACE_ERROR("RecoverLostInterrupt: device busy, status 0x%02x\n", status);
|
TRACE_ERROR("RecoverLostInterrupt: device busy, status 0x%02x\n", status);
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
@@ -828,6 +832,15 @@ ATAChannel::_WriteRegs(ata_task_file *taskFile, ata_reg_mask mask)
|
|||||||
return fController->write_command_block_regs(fCookie, taskFile, mask);
|
return fController->write_command_block_regs(fCookie, taskFile, mask);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint8
|
||||||
|
ATAChannel::_Status()
|
||||||
|
{
|
||||||
|
ata_task_file taskFile;
|
||||||
|
if (_ReadRegs(&taskFile, ATA_MASK_STATUS) != B_OK)
|
||||||
|
return 0x01;
|
||||||
|
return taskFile.read.status;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
ATAChannel::_WriteControl(uint8 value)
|
ATAChannel::_WriteControl(uint8 value)
|
||||||
|
|||||||
@@ -120,6 +120,7 @@ private:
|
|||||||
status_t _WriteRegs(ata_task_file *taskFile,
|
status_t _WriteRegs(ata_task_file *taskFile,
|
||||||
ata_reg_mask mask);
|
ata_reg_mask mask);
|
||||||
status_t _WriteControl(uint8 value);
|
status_t _WriteControl(uint8 value);
|
||||||
|
uint8 _Status();
|
||||||
|
|
||||||
void _FlushAndWait(bigtime_t waitTime);
|
void _FlushAndWait(bigtime_t waitTime);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user