When closing, wait for pending xfers to drain before unlocking the door,
and wait again before deleting the reference to the adapter.
This commit is contained in:
parent
1ddd2ffec0
commit
dcc5f32c2b
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cd.c,v 1.116 1998/11/20 00:35:39 thorpej Exp $ */
|
||||
/* $NetBSD: cd.c,v 1.117 1998/12/08 00:18:46 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -377,12 +377,14 @@ cdclose(dev, flag, fmt, p)
|
||||
cd->sc_dk.dk_copenmask | cd->sc_dk.dk_bopenmask;
|
||||
|
||||
if (cd->sc_dk.dk_openmask == 0) {
|
||||
/* XXXX Must wait for I/O to complete! */
|
||||
scsipi_wait_drain(cd->sc_link);
|
||||
|
||||
scsipi_prevent(cd->sc_link, PR_ALLOW,
|
||||
SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY);
|
||||
cd->sc_link->flags &= ~SDEV_OPEN;
|
||||
|
||||
scsipi_wait_drain(cd->sc_link);
|
||||
|
||||
scsipi_adapter_delref(cd->sc_link);
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sd.c,v 1.137 1998/11/20 00:35:40 thorpej Exp $ */
|
||||
/* $NetBSD: sd.c,v 1.138 1998/12/08 00:18:46 thorpej Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -431,12 +431,14 @@ sdclose(dev, flag, fmt, p)
|
||||
sd->sc_ops->sdo_flush != NULL)
|
||||
(*sd->sc_ops->sdo_flush)(sd, 0);
|
||||
|
||||
/* XXXX Must wait for I/O to complete! */
|
||||
scsipi_wait_drain(sd->sc_link);
|
||||
|
||||
scsipi_prevent(sd->sc_link, PR_ALLOW,
|
||||
SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_NOT_READY);
|
||||
sd->sc_link->flags &= ~(SDEV_OPEN|SDEV_MEDIA_LOADED);
|
||||
|
||||
scsipi_wait_drain(sd->sc_link);
|
||||
|
||||
scsipi_adapter_delref(sd->sc_link);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user