diff --git a/sys/dev/scsipi/ch.c b/sys/dev/scsipi/ch.c index db537d670ee6..dcefcaba2c3f 100644 --- a/sys/dev/scsipi/ch.c +++ b/sys/dev/scsipi/ch.c @@ -1,4 +1,4 @@ -/* $NetBSD: ch.c,v 1.35 1998/11/20 00:35:39 thorpej Exp $ */ +/* $NetBSD: ch.c,v 1.36 1998/12/08 00:19:56 thorpej Exp $ */ /* * Copyright (c) 1996, 1997, 1998 Jason R. Thorpe @@ -273,6 +273,8 @@ chclose(dev, flags, fmt, p) { struct ch_softc *sc = ch_cd.cd_devs[CHUNIT(dev)]; + scsipi_wait_drain(sc->sc_link); + scsipi_adapter_delref(sc->sc_link); sc->sc_link->flags &= ~SDEV_OPEN; return (0); diff --git a/sys/dev/scsipi/if_se.c b/sys/dev/scsipi/if_se.c index 8faeca40fff9..2bc53a672663 100644 --- a/sys/dev/scsipi/if_se.c +++ b/sys/dev/scsipi/if_se.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_se.c,v 1.21 1998/11/20 00:35:39 thorpej Exp $ */ +/* $NetBSD: if_se.c,v 1.22 1998/12/08 00:19:27 thorpej Exp $ */ /* * Copyright (c) 1997 Ian W. Dall @@ -1201,6 +1201,9 @@ seclose(dev, flag, fmt, p) struct se_softc *sc = se_cd.cd_devs[SEUNIT(dev)]; SC_DEBUG(sc->sc_link, SDEV_DB1, ("closing\n")); + + scsipi_wait_drain(sc->sc_link); + scsipi_adapter_delref(sc->sc_link); sc->sc_link->flags &= ~SDEV_OPEN; diff --git a/sys/dev/scsipi/ss.c b/sys/dev/scsipi/ss.c index 990c5ac0034e..beb703c54eb4 100644 --- a/sys/dev/scsipi/ss.c +++ b/sys/dev/scsipi/ss.c @@ -1,4 +1,4 @@ -/* $NetBSD: ss.c,v 1.23 1998/11/20 00:35:40 thorpej Exp $ */ +/* $NetBSD: ss.c,v 1.24 1998/12/08 00:19:27 thorpej Exp $ */ /* * Copyright (c) 1995 Kenneth Stailey. All rights reserved. @@ -261,6 +261,8 @@ ssclose(dev, flag, mode, p) ss->flags &= ~SSF_TRIGGERED; } + scsipi_wait_drain(ss->sc_link); + scsipi_adapter_delref(ss->sc_link); ss->sc_link->flags &= ~SDEV_OPEN; diff --git a/sys/dev/scsipi/st.c b/sys/dev/scsipi/st.c index f52ace11c064..546b3b44319e 100644 --- a/sys/dev/scsipi/st.c +++ b/sys/dev/scsipi/st.c @@ -1,4 +1,4 @@ -/* $NetBSD: st.c,v 1.106 1998/11/20 00:35:40 thorpej Exp $ */ +/* $NetBSD: st.c,v 1.107 1998/12/08 00:19:27 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -724,6 +724,8 @@ stclose(dev, flags, mode, p) break; } + scsipi_wait_drain(st->sc_link); + scsipi_adapter_delref(st->sc_link); st->sc_link->flags &= ~SDEV_OPEN; diff --git a/sys/dev/scsipi/uk.c b/sys/dev/scsipi/uk.c index c61b5176dc03..f88372560f5c 100644 --- a/sys/dev/scsipi/uk.c +++ b/sys/dev/scsipi/uk.c @@ -1,4 +1,4 @@ -/* $NetBSD: uk.c,v 1.26 1998/11/20 00:35:40 thorpej Exp $ */ +/* $NetBSD: uk.c,v 1.27 1998/12/08 00:19:28 thorpej Exp $ */ /*- * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -178,6 +178,9 @@ ukclose(dev, flag, fmt, p) struct uk_softc *uk = uk_cd.cd_devs[UKUNIT(dev)]; SC_DEBUG(uk->sc_link, SDEV_DB1, ("closing\n")); + + scsipi_wait_drain(uk->sc_link); + scsipi_adapter_delref(uk->sc_link); uk->sc_link->flags &= ~SDEV_OPEN;