diff options
author | sos <sos@FreeBSD.org> | 2003-12-10 23:06:24 +0000 |
---|---|---|
committer | sos <sos@FreeBSD.org> | 2003-12-10 23:06:24 +0000 |
commit | fa790cf424666ffddbe9e65a61da340b6ff48db3 (patch) | |
tree | 587317b01b967973292876231129cb59fa639484 | |
parent | 0fad8ea5b01af90b783b856299c0930f3f7beb1c (diff) | |
download | FreeBSD-src-fa790cf424666ffddbe9e65a61da340b6ff48db3.zip FreeBSD-src-fa790cf424666ffddbe9e65a61da340b6ff48db3.tar.gz |
Finetune last commit, we need to take care of empty channels.
-rw-r--r-- | sys/dev/ata/ata-lowlevel.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c index f5bc78b..c3837f8 100644 --- a/sys/dev/ata/ata-lowlevel.c +++ b/sys/dev/ata/ata-lowlevel.c @@ -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); } |