summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2008-06-10 04:46:08 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2008-06-10 04:46:08 +0000
commit753ee0d376f55c458981efc73ade5b952fb6347d (patch)
tree935d5cf26595478a4aab24415874769fe8bae333 /sys
parent7a370c63723dc97ac38775067357dd7de6442e84 (diff)
When copying stuff from code that runs with interrupts enabled to code
that may run without interrupts, don't forget to add scsi_autoconf to the flags and POLL for the result rather than wait for an interrupt that will never come. Fixes Dale's Iomega Jazz drive on the ahc here, and no doubt many other device combinations.
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/sd.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index 62ce54cba60..1c61242b2c7 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.145 2008/06/02 17:01:13 krw Exp $ */
+/* $OpenBSD: sd.c,v 1.146 2008/06/10 04:46:07 krw Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -214,8 +214,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
* media loaded unless its been locked in.
*/
if ((sc_link->flags & SDEV_REMOVABLE) != 0)
- scsi_prevent(sc_link, PR_PREVENT, SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
+ scsi_prevent(sc_link, PR_PREVENT, scsi_autoconf |
+ SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE |
+ SCSI_SILENT);
/* Check that it is still responding and ok. */
error = scsi_test_unit_ready(sd->sc_link, TEST_READY_RETRIES,
@@ -229,8 +230,9 @@ sdattach(struct device *parent, struct device *self, void *aux)
scsi_autoconf | SCSI_SILENT | SCSI_IGNORE_MEDIA_CHANGE);
if ((sc_link->flags & SDEV_REMOVABLE) != 0)
- scsi_prevent(sc_link, PR_ALLOW, SCSI_IGNORE_ILLEGAL_REQUEST |
- SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT);
+ scsi_prevent(sc_link, PR_ALLOW, scsi_autoconf |
+ SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE |
+ SCSI_SILENT);
printf("%s: ", sd->sc_dev.dv_xname);
switch (result) {