summaryrefslogtreecommitdiffstats
path: root/sys/dev
diff options
context:
space:
mode:
authorsos <sos@FreeBSD.org>2004-12-24 13:38:25 +0000
committersos <sos@FreeBSD.org>2004-12-24 13:38:25 +0000
commit35197bc60b1c167af86662764d352ae4ad0b3eee (patch)
tree3bcc8f50bb635ebcdb1ff52735c1288ba6c5dc2c /sys/dev
parentad59528a7976e2a91088f293d53067ee0aef9ba0 (diff)
downloadFreeBSD-src-35197bc60b1c167af86662764d352ae4ad0b3eee.zip
FreeBSD-src-35197bc60b1c167af86662764d352ae4ad0b3eee.tar.gz
Loosen the probe a bit.
Try to get out of probing as early as possible on (hopefully) vacant channels.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/ata-lowlevel.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/sys/dev/ata/ata-lowlevel.c b/sys/dev/ata/ata-lowlevel.c
index 2a08bd0..52a50f3 100644
--- a/sys/dev/ata/ata-lowlevel.c
+++ b/sys/dev/ata/ata-lowlevel.c
@@ -493,7 +493,7 @@ ata_end_transaction(struct ata_request *request)
static void
ata_generic_reset(struct ata_channel *ch)
{
- u_int8_t err, lsb, msb, ostat0, ostat1;
+ u_int8_t err = 0, lsb = 0, msb = 0, ostat0, ostat1;
u_int8_t stat0 = 0, stat1 = 0;
int mask = 0, timeout;
@@ -602,17 +602,21 @@ ata_generic_reset(struct ata_channel *ch)
}
}
if (mask == 0x01) /* wait for master only */
- if (!(stat0 & ATA_S_BUSY) || (stat0 == 0xff && timeout > 5))
+ if (!(stat0 & ATA_S_BUSY) || (stat0 == 0xff && timeout > 5) ||
+ (stat0 == err && lsb == err && msb == err && timeout > 5))
break;
if (mask == 0x02) /* wait for slave only */
- if (!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 5))
+ if (!(stat1 & ATA_S_BUSY) || (stat1 == 0xff && timeout > 5) ||
+ (stat1 == err && lsb == err && msb == err && timeout > 5))
break;
if (mask == 0x03) { /* wait for both master & slave */
if (!(stat0 & ATA_S_BUSY) && !(stat1 & ATA_S_BUSY))
break;
- if (stat0 == 0xff && timeout > 5)
+ if ((stat0 == 0xff && timeout > 5) ||
+ (stat0 == err && lsb == err && msb == err && timeout > 5))
mask &= ~0x01;
- if (stat1 == 0xff && timeout > 5)
+ if ((stat1 == 0xff && timeout > 5) ||
+ (stat1 == err && lsb == err && msb == err && timeout > 5))
mask &= ~0x02;
}
ata_udelay(100000);
OpenPOWER on IntegriCloud