summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2008-06-15 00:52:25 +0000
committerkrw <krw@openbsd.org>2008-06-15 00:52:25 +0000
commit50aa74c8cb6eee8b5ce8cdc56fbd560118c16729 (patch)
treeaaea371f61abaf6c795893d3f9630878cdf45705
parentWhen generating a new volume, ask the user to re-type the passphrase for (diff)
downloadwireguard-openbsd-50aa74c8cb6eee8b5ce8cdc56fbd560118c16729.tar.xz
wireguard-openbsd-50aa74c8cb6eee8b5ce8cdc56fbd560118c16729.zip
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@
-rw-r--r--sys/scsi/scsi_base.c7
-rw-r--r--sys/scsi/sd.c4
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);