summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkrw <krw@openbsd.org>2008-06-10 04:46:07 +0000
committerkrw <krw@openbsd.org>2008-06-10 04:46:07 +0000
commitb82c99f88a9d74a8f1a7d7de47bde09279cf5894 (patch)
tree4102aadb5e5ac29768341ac18bf2255c7726acc9
parentIf we encounter an error during expanding line of a trigger file, print an (diff)
downloadwireguard-openbsd-b82c99f88a9d74a8f1a7d7de47bde09279cf5894.tar.xz
wireguard-openbsd-b82c99f88a9d74a8f1a7d7de47bde09279cf5894.zip
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.
-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) {