summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-02-27 01:12:12 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-02-27 01:12:12 +0000
commit2b2c7caa91ca79f0b10cb6d633355d94cf49698f (patch)
tree8d8aa2c28c994e4bb7023ecbc44daff5eef672d7 /sys
parentb7aef825f62a7a94ddfc3f5ec9d0861f8429a4b4 (diff)
If test_unit_ready() in sdattach() returns EIO, try to spin up unit
exactly as is done in sdopen(). This improves the chances of getting valid geometry/size and avoiding 'drive offline' errors, without subjecting the device to anything it won't see anyway. No impact on devices that already work. Fixes problem with Jim Rees' Hitachi DK23DA in an Archos Multimedia Jukebox. Without adding quirks! Tested by Jim Rees. ok marco@.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 29c04e65399..ce4baa13be1 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.70 2004/05/28 23:50:15 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.71 2005/02/27 01:12:11 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -222,6 +222,10 @@ sdattach(parent, self, aux)
scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST |
SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
+ /* Start the pack spinning if necessary. */
+ if (error == EIO)
+ error = scsi_start(sc_link, SSS_START, 0);
+
/* Fill in name struct for spoofed label */
viscpy(sd->name.vendor, sa->sa_inqbuf->vendor, 8);
viscpy(sd->name.product, sa->sa_inqbuf->product, 16);