summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-08-12 14:28:03 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-08-12 14:28:03 +0000
commita2ad26eeed1b3dec69c188b30427179069a1ca49 (patch)
tree7c2bf4c01e8d96bb4487647ef322eb8289c20e7f /sys/dev/ic
parent7398e0972b49780bd9854f30a44aaf7f84fecd45 (diff)
always mark an xs complete if we're about to return COMPLETE to the
midlayer. always call scsi_done on the xs too.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mpi.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 35f5a165ac0..2244e286e31 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.111 2009/08/08 09:35:22 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.112 2009/08/12 14:28:02 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -1146,6 +1146,7 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
xs->sense.flags = SKEY_ILLEGAL_REQUEST;
xs->sense.add_sense_code = 0x20;
xs->error = XS_SENSE;
+ xs->flags |= ITSDONE;
s = splbio();
scsi_done(xs);
splx(s);
@@ -1209,6 +1210,7 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
if (mpi_load_xs(ccb) != 0) {
xs->error = XS_DRIVER_STUFFUP;
+ xs->flags |= ITSDONE;
s = splbio();
mpi_put_ccb(sc, ccb);
scsi_done(xs);
@@ -1219,8 +1221,13 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
timeout_set(&xs->stimeout, mpi_timeout_xs, ccb);
if (xs->flags & SCSI_POLL) {
- if (mpi_poll(sc, ccb, xs->timeout) != 0)
+ if (mpi_poll(sc, ccb, xs->timeout) != 0) {
xs->error = XS_DRIVER_STUFFUP;
+ xs->flags |= ITSDONE;
+ s = splbio();
+ scsi_done(xs);
+ splx(s);
+ }
return (COMPLETE);
}