mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Finetune last commit, we need to take care of empty channels.
This commit is contained in:
parent
ba3fa22e8c
commit
b9e240face
1 changed files with 7 additions and 3 deletions
|
|
@ -606,10 +606,14 @@ ata_reset(struct ata_channel *ch)
|
|||
if (mask == 0x02) /* wait for slave only */
|
||||
if (!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 20))
|
||||
break;
|
||||
if (mask == 0x03) /* wait for both master & slave */
|
||||
if ((!(stat0 & ATA_S_BUSY) || (stat0 == 0xff && timeout > 20)) &&
|
||||
(!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 20)))
|
||||
if (mask == 0x03) { /* wait for both master & slave */
|
||||
if (!(stat0 & ATA_S_BUSY) && !(stat1 & ATA_S_BUSY))
|
||||
break;
|
||||
if (stat0 == 0xff && timeout > 20)
|
||||
mask &= ~0x01;
|
||||
if (stat1 == 0xff && timeout > 20)
|
||||
mask &= ~0x02;
|
||||
}
|
||||
DELAY(100000);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue