diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-15 00:52:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2008-06-15 00:52:26 +0000 |
commit | 61395e85722f2a2cd003f0854b2f69141bae1919 (patch) | |
tree | f7fd0ae8f354c128017d27f35ee8b3b1acf926fb /sys/scsi | |
parent | 216d5b845bb98ff774cb0ead549e7ba1a88e3309 (diff) |
Treat SENSE_NOT_READY_INIT_REQUIRED sense errors the same as
SENSE_NOT_READY_BECOMING_READY sense errors. Some devices such as USB
Zip250 drives return the former when they mean the latter. Give the
first TEST UNIT READY command three times the usual retries so more
devices have time to get ready. This allows more removable devices to
detect media details and avoid issuing 'drive offline' messages.
ok marco@
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/scsi_base.c | 7 | ||||
-rw-r--r-- | sys/scsi/sd.c | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c index 20e8ccee5ec..438da837e9c 100644 --- a/sys/scsi/scsi_base.c +++ b/sys/scsi/scsi_base.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.126 2008/06/14 01:57:51 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.127 2008/06/15 00:52:25 krw Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -1062,9 +1062,10 @@ scsi_interpret_sense(struct scsi_xfer *xs) case SENSE_NOT_READY_INPROGRESS: case SENSE_NOT_READY_LONGWRITE: case SENSE_NOT_READY_SELFTEST: + case SENSE_NOT_READY_INIT_REQUIRED: SC_DEBUG(sc_link, SDEV_DB1, - ("not ready: busy (%#x)\n", - sense->add_sense_code_qual)); + ("not ready (ASC_ASCQ == %#x)\n", + ASC_ASCQ(sense))); return (scsi_delay(xs, 1)); case SENSE_NOMEDIUM: case SENSE_NOMEDIUM_TCLOSED: diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 3f1a182240d..6dc072ef776 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.147 2008/06/15 00:36:41 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.148 2008/06/15 00:52:25 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -219,7 +219,7 @@ sdattach(struct device *parent, struct device *self, void *aux) SCSI_SILENT); /* Check that it is still responding and ok. */ - error = scsi_test_unit_ready(sd->sc_link, TEST_READY_RETRIES, + error = scsi_test_unit_ready(sd->sc_link, TEST_READY_RETRIES * 3, scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT); |