summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1999-03-23 10:22:19 +0000
committerbde <bde@FreeBSD.org>1999-03-23 10:22:19 +0000
commit9e462600ccf15d2a1b523df033a65d6f7ae14aaa (patch)
tree532580743c290b5095af836cff6c7c8fc4dddef7 /sys
parent87fd768abf6ad033b5935e46d21c659a2cb854db (diff)
downloadFreeBSD-src-9e462600ccf15d2a1b523df033a65d6f7ae14aaa.zip
FreeBSD-src-9e462600ccf15d2a1b523df033a65d6f7ae14aaa.tar.gz
Fixed a couple of missing drive selects in wdreset(). This mainly
affects cases where there is a slave but no master. These bugs were usually recovered from provided ATAPI was configured, but only after lengthy delays. Configuring ATAPI still fixes some bugs for non-atapi drives. Don't wait for seek complete in wdreset(). If necessary for pre-ata drives, it can be waited for later (we got it wrong by only looking at it for drive 0 anyway). It is set as part of a historical signature for ata drives but doesn't say anything useful about the reset state. It is cleared as part of a non-historical signature for atapi drives so that drivers which don't understand atapi drives seem to see no drive. Waiting for it caused lengthy delays and broke the status returned by wdreset() in cases where the master was not an ata drive. Then the whole wdprobe() failed in some cases where the recovery code didn't work. Don't wait for drive ready in wdreset(). The considerations are the same as for seek complete, except drive ready does say something useful about the reset state of ata drives, and waiting for it later is required anyway for such drives. Lengthy delays can now be avoided by not configuring nonexistent (ata) drives. Unfortunately, this breaks detection of atapi drives in some configurations.
Diffstat (limited to 'sys')
-rw-r--r--sys/i386/isa/wd.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/i386/isa/wd.c b/sys/i386/isa/wd.c
index 9d988f3..d70dac7 100644
--- a/sys/i386/isa/wd.c
+++ b/sys/i386/isa/wd.c
@@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)wd.c 7.2 (Berkeley) 5/9/91
- * $Id: wd.c,v 1.188 1999/02/10 00:03:36 ken Exp $
+ * $Id: wd.c,v 1.189 1999/02/20 22:16:13 dt Exp $
*/
/* TODO:
@@ -328,6 +328,7 @@ wdprobe(struct isa_device *dvp)
if (inb(du->dk_port + wd_cyl_lo) == 0xff) { /* XXX too weak */
#ifdef ATAPI
/* There is no master, try the ATAPI slave. */
+ du->dk_unit = 1;
outb(du->dk_port + wd_sdh, WDSD_IBM | 0x10);
outb(du->dk_port + wd_cyl_lo, 0xa5);
if (inb(du->dk_port + wd_cyl_lo) == 0xff)
@@ -2299,8 +2300,9 @@ wdreset(struct disk *du)
outb(du->dk_altport, WDCTL_IDS | WDCTL_RST);
DELAY(10 * 1000);
outb(du->dk_altport, WDCTL_IDS);
+ outb(du->dk_port + wd_sdh, WDSD_IBM | (du->dk_unit << 4));
#ifdef ATAPI
- if (wdwait(du, WDCS_READY | WDCS_SEEKCMPLT, TIMEOUT) != 0)
+ if (wdwait(du, 0, TIMEOUT) != 0)
err = 1; /* no IDE drive found */
du->dk_error = inb(du->dk_port + wd_error);
if (du->dk_error != 0x01)
OpenPOWER on IntegriCloud