summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2005-11-13 03:27:43 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2005-11-13 03:27:43 +0000
commitafd062b7b153ae05c36a62b3b6fb7e6bd7953bb1 (patch)
treedbd64cade49e8e99487d358dad324ba6758fb14f
parent1769ad36a1a2afc078d261b3d5becd1a22256870 (diff)
Use SCSI_DELAY only once. Document it. Default to no delay.
Fixes two second system 'freeze' when umass device plugged in. Speeds up boot by not waiting for a minimum of 2 seconds at each scsi bus. ok jmc@ pedro@ deraadt@
-rw-r--r--share/man/man4/options.47
-rw-r--r--sys/scsi/scsi_base.c7
-rw-r--r--sys/scsi/scsiconf.c11
3 files changed, 13 insertions, 12 deletions
diff --git a/share/man/man4/options.4 b/share/man/man4/options.4
index 55dedfabb0d..69d18ea7097 100644
--- a/share/man/man4/options.4
+++ b/share/man/man4/options.4
@@ -1,4 +1,4 @@
-.\" $OpenBSD: options.4,v 1.169 2005/11/06 17:50:06 kettenis Exp $
+.\" $OpenBSD: options.4,v 1.170 2005/11/13 03:27:41 krw Exp $
.\" $NetBSD: options.4,v 1.21 1997/06/25 03:13:00 thorpej Exp $
.\"
.\" Copyright (c) 1998 Theo de Raadt
@@ -871,6 +871,11 @@ which affects processor cycle counter.
.El
.Ss SCSI Subsystem Options
.Bl -ohang
+.It Cd option SCSI_DELAY=value
+Delay for
+.Ar value
+seconds before starting to probe the first SCSI bus.
+This can be used if a SCSI device needs extra time to get ready.
.It Cd option SCSITERSE
Terser SCSI error messages.
This omits the table for decoding ASC/ASCQ info, saving about 30KB.
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index badb63d741a..570166d7ead 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsi_base.c,v 1.95 2005/11/13 02:39:45 krw Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.96 2005/11/13 03:27:42 krw Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
@@ -79,6 +79,11 @@ scsi_init()
return;
scsi_init_done = 1;
+#if defined(SCSI_DELAY) && SCSI_DELAY > 0
+ /* Historical. Older buses may need a moment to stabilize. */
+ delay(1000000 * SCSI_DELAY);
+#endif
+
/* Initialize the scsi_xfer pool. */
pool_init(&scsi_xfer_pool, sizeof(struct scsi_xfer), 0,
0, 0, "scxspl", NULL);
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index 38a3e56449a..f53c7d92b28 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: scsiconf.c,v 1.97 2005/10/10 20:06:12 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.98 2005/11/13 03:27:42 krw Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
@@ -179,15 +179,6 @@ scsibusattach(parent, self, aux)
bzero(sb->sc_link[i], nbytes);
}
-#if defined(SCSI_DELAY) && SCSI_DELAY > 2
- printf("%s: waiting for scsi devices to settle\n",
- sb->sc_dev.dv_xname);
-#else /* SCSI_DELAY > 2 */
-#undef SCSI_DELAY
-#define SCSI_DELAY 2
-#endif /* SCSI_DELAY */
- delay(1000000 * SCSI_DELAY);
-
scsi_probe_bus(sb->sc_dev.dv_unit, -1, -1);
}