Subject: have scsibus sleep only one time
To: None <tech-kern@netbsd.org>
From: Manuel Bouyer <bouyer@antioche.lip6.fr>
List: tech-kern
Date: 03/09/2003 23:38:21
--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Hi,
would anyone object to the attached change ?
It makes all the attached scsibusses sleep "in parallel" instead of
sequencially, which is a real win for machines with several SCSI busses.
On my DS20, which has 8 scsi busses, this saves 14 seconds on boot.

--
Manuel Bouyer, LIP6, Universite Paris VI.           Manuel.Bouyer@lip6.fr
     NetBSD: 24 ans d'experience feront toujours la difference
--

--J2SCkAp4GZ/dPZZf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="diff.scsiconf"

? diff.scsiconf
Index: scsiconf.c
===================================================================
RCS file: /cvsroot/src/sys/dev/scsipi/scsiconf.c,v
retrieving revision 1.200
diff -u -r1.200 scsiconf.c
--- scsiconf.c	2003/02/10 08:10:51	1.200
+++ scsiconf.c	2003/03/09 22:28:25
@@ -207,6 +207,14 @@
 #ifndef SCSI_DELAY
 #define SCSI_DELAY 2
 #endif
+	if ((chan->chan_flags & SCSIPI_CHAN_NOSETTLE) == 0 &&
+	    SCSI_DELAY > 0) {
+		printf("%s: waiting %d seconds for devices to settle...\n",
+		    sc->sc_dev.dv_xname, SCSI_DELAY);
+		/* ...an identifier we know no one will use... */
+		(void) tsleep(scsibus_config, PRIBIO,
+		    "scsidly", SCSI_DELAY * hz);
+	}
 
 	/* Make sure the devices probe in scsibus order to avoid jitter. */
 	simple_lock(&scsibus_interlock);
@@ -219,15 +227,6 @@
 	}
 
 	simple_unlock(&scsibus_interlock);
-
-	if ((chan->chan_flags & SCSIPI_CHAN_NOSETTLE) == 0 &&
-	    SCSI_DELAY > 0) {
-		printf("%s: waiting %d seconds for devices to settle...\n",
-		    sc->sc_dev.dv_xname, SCSI_DELAY);
-		/* ...an identifier we know no one will use... */
-		(void) tsleep(scsibus_config, PRIBIO,
-		    "scsidly", SCSI_DELAY * hz);
-	}
 
 	scsi_probe_bus(sc, -1, -1);
 

--J2SCkAp4GZ/dPZZf--