summaryrefslogtreecommitdiff
path: root/sys/dev/ata/ata.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-07-12 01:45:44 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2001-07-12 01:45:44 +0000
commit7d0871902ea2c285d7ef3fda5e59917b9aef60fb (patch)
treec6ba8449974ec3e2a43201b9b0507cd3cf11fb4f /sys/dev/ata/ata.c
parent9ffda6625099c2ecc8b206c41d9abe05eb3125be (diff)
Rework of probe code. Try better to deal with floating buses. Depending
on the value floating on the bus, we would occasionally skip the register writability tests. Whoops... Move fix for a flash device that doesn't wake up until a command is sent Try to supress spurious interrupts. However, if one does happen, acknowledge it anyway by reading status. This prevents the interrupt condition from persisting.
Diffstat (limited to 'sys/dev/ata/ata.c')
-rw-r--r--sys/dev/ata/ata.c19
1 files changed, 2 insertions, 17 deletions
diff --git a/sys/dev/ata/ata.c b/sys/dev/ata/ata.c
index 8975a858823..a4fe7dd82a4 100644
--- a/sys/dev/ata/ata.c
+++ b/sys/dev/ata/ata.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ata.c,v 1.11 2001/07/09 20:10:40 csapuntz Exp $ */
+/* $OpenBSD: ata.c,v 1.12 2001/07/12 01:45:42 csapuntz Exp $ */
/* $NetBSD: ata.c,v 1.9 1999/04/15 09:41:09 bouyer Exp $ */
/*
* Copyright (c) 1998 Manuel Bouyer. All rights reserved.
@@ -70,18 +70,16 @@ ata_get_params(drvp, flags, prms)
int i;
u_int16_t *p;
- int try = 0;
WDCDEBUG_PRINT(("ata_get_parms\n"), DEBUG_FUNCS);
- again:
bzero(tb, sizeof(tb));
bzero(prms, sizeof(struct ataparams));
bzero(&wdc_c, sizeof(struct wdc_command));
if (drvp->drive_flags & DRIVE_ATA) {
wdc_c.r_command = WDCC_IDENTIFY;
- wdc_c.r_st_bmask = (try == 0) ? WDCS_DRDY : 0;
+ wdc_c.r_st_bmask = WDCS_DRDY;
wdc_c.r_st_pmask = WDCS_DRQ;
wdc_c.timeout = 1000; /* 1s */
} else if (drvp->drive_flags & DRIVE_ATAPI) {
@@ -105,22 +103,9 @@ ata_get_params(drvp, flags, prms)
}
if (wdc_c.flags & (AT_ERROR | AT_TIMEOU | AT_DF)) {
- struct channel_softc *chp = drvp->chnl_softc;
-
WDCDEBUG_PRINT(("IDENTIFY failed: 0x%x\n", wdc_c.flags)
, DEBUG_PROBE);
- /* Andreas Gunnarsson reports a setup with a flash
- disk where the ATA drive remains comatose until
- it is sent a command */
- if (try == 0 && (drvp->drive_flags & DRIVE_ATA) &&
- (wdc_c.flags & AT_TIMEOU) &&
- !(chp->ch_status & WDCS_BSY)) {
- WDCDEBUG_PRINT(("Retrying IDENTIFY\n"), DEBUG_PROBE);
- try++;
- goto again;
- }
-
return CMD_ERR;
} else {
#if BYTE_ORDER == BIG_ENDIAN