From: csapuntz Date: Sat, 8 Apr 2000 19:19:33 +0000 (+0000) Subject: These days, attach can occur outside the tsleep-restricted world of X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=c8de565ee402c43754559d8e0f6b003ab4c6f78f;p=openbsd These days, attach can occur outside the tsleep-restricted world of BSD autoconf. Don't use POLL & NOSLEEP mode if attaching after autoconf --- diff --git a/sys/scsi/ch.c b/sys/scsi/ch.c index c9208ca2f36..8aae1578307 100644 --- a/sys/scsi/ch.c +++ b/sys/scsi/ch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ch.c,v 1.8 1998/03/22 20:19:59 tholo Exp $ */ +/* $OpenBSD: ch.c,v 1.9 2000/04/08 19:19:33 csapuntz Exp $ */ /* $NetBSD: ch.c,v 1.26 1997/02/21 22:06:52 thorpej Exp $ */ /* @@ -188,7 +188,7 @@ chattach(parent, self, aux) * Get information about the device. Note we can't use * interrupts yet. */ - if (ch_get_params(sc, SCSI_AUTOCONF)) + if (ch_get_params(sc, scsi_autoconf)) printf("%s: offline\n", sc->sc_dev.dv_xname); else { #define PLURAL(c) (c) == 1 ? "" : "s" diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c index 44e610a6d14..e3e47f40554 100644 --- a/sys/scsi/scsiconf.c +++ b/sys/scsi/scsiconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.c,v 1.50 2000/02/21 08:21:22 mjacob Exp $ */ +/* $OpenBSD: scsiconf.c,v 1.51 2000/04/08 19:19:33 csapuntz Exp $ */ /* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */ /* @@ -100,6 +100,8 @@ int scsidebug_targets = SCSIDEBUG_TARGETS; int scsidebug_luns = SCSIDEBUG_LUNS; int scsidebug_level = SCSIDEBUG_LEVEL; +int scsi_autoconf = SCSI_AUTOCONF; + int scsibusprint __P((void *, const char *)); int @@ -144,6 +146,10 @@ scsibusattach(parent, self, aux) struct scsibus_softc *sb = (struct scsibus_softc *)self; struct scsi_link *sc_link_proto = aux; int nbytes, i; + extern int cold; + + if (!cold) + scsi_autoconf = 0; sc_link_proto->scsibus = sb->sc_dev.dv_unit; sb->adapter_link = sc_link_proto; @@ -707,17 +713,17 @@ scsi_probedev(scsi, target, lun) #endif /* SCSIDEBUG */ (void) scsi_test_unit_ready(sc_link, - SCSI_AUTOCONF | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY | SCSI_IGNORE_MEDIA_CHANGE); + scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY | SCSI_IGNORE_MEDIA_CHANGE); #ifdef SCSI_2_DEF /* some devices need to be told to go to SCSI2 */ /* However some just explode if you tell them this.. leave it out */ - scsi_change_def(sc_link, SCSI_AUTOCONF | SCSI_SILENT); + scsi_change_def(sc_link, scsi_autoconf | SCSI_SILENT); #endif /* SCSI_2_DEF */ /* Now go ask the device all about itself. */ bzero(&inqbuf, sizeof(inqbuf)); - if (scsi_inquire(sc_link, &inqbuf, SCSI_AUTOCONF) != 0) + if (scsi_inquire(sc_link, &inqbuf, scsi_autoconf) != 0) goto bad; { diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 04a6f2e20d2..161e31cada7 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.21 1999/12/16 05:17:36 mjacob Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.22 2000/04/08 19:19:33 csapuntz Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -88,6 +88,11 @@ typedef int boolean; struct buf; struct scsi_xfer; +/* + * Temporary hack + */ +extern int scsi_autoconf; + /* * These entrypoints are called by the high-end drivers to get services from * whatever low-end drivers they are attached to each adapter type has one of diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index 16e51f0220b..7cc7995c85d 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.41 1999/12/05 02:49:17 deraadt Exp $ */ +/* $OpenBSD: sd.c,v 1.42 2000/04/08 19:19:33 csapuntz Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -207,7 +207,7 @@ sdattach(parent, self, aux) if ((sd->sc_link->quirks & SDEV_NOSTARTUNIT) == 0) { error = scsi_start(sd->sc_link, SSS_START, - SCSI_AUTOCONF | SCSI_IGNORE_ILLEGAL_REQUEST | + scsi_autoconf | SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE | SCSI_SILENT); } else error = 0; @@ -221,7 +221,7 @@ sdattach(parent, self, aux) result = SDGP_RESULT_OFFLINE; else result = (*sd->sc_ops->sdo_get_parms)(sd, &sd->params, - SCSI_AUTOCONF); + scsi_autoconf); printf("%s: ", sd->sc_dev.dv_xname); switch (result) { diff --git a/sys/scsi/st.c b/sys/scsi/st.c index 1b3eccbd371..6db850ccf26 100644 --- a/sys/scsi/st.c +++ b/sys/scsi/st.c @@ -1,4 +1,4 @@ -/* $OpenBSD: st.c,v 1.27 1999/09/05 20:58:03 niklas Exp $ */ +/* $OpenBSD: st.c,v 1.28 2000/04/08 19:19:33 csapuntz Exp $ */ /* $NetBSD: st.c,v 1.71 1997/02/21 23:03:49 thorpej Exp $ */ /* @@ -402,9 +402,9 @@ stattach(parent, self, aux) printf("\n"); printf("%s: %s", st->sc_dev.dv_xname, st->quirkdata ? "rogue, " : ""); if (scsi_test_unit_ready(sc_link, - SCSI_AUTOCONF | SCSI_SILENT | SCSI_IGNORE_MEDIA_CHANGE) || + scsi_autoconf | SCSI_SILENT | SCSI_IGNORE_MEDIA_CHANGE) || st_mode_sense(st, - SCSI_AUTOCONF | SCSI_SILENT | SCSI_IGNORE_MEDIA_CHANGE)) + scsi_autoconf | SCSI_SILENT | SCSI_IGNORE_MEDIA_CHANGE)) printf("drive empty\n"); else { printf("density code 0x%x, ", st->media_density);