summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2006-08-03 08:48:45 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2006-08-03 08:48:45 +0000
commit7f9ebcc8a79103c5ec13b1716a326349887b4a64 (patch)
tree3f6f16882b2c1bb61df2359524b028d83123281d /sys/dev/ic
parent493b52f84ddaa90aad7ebc96027fe00f247fb91b (diff)
always call scsi_done at splbio. issue found by pedro@
while here protect submission of the scsi command with splbio as well.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/mpi.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/dev/ic/mpi.c b/sys/dev/ic/mpi.c
index 301ae5044b7..9b195650dbc 100644
--- a/sys/dev/ic/mpi.c
+++ b/sys/dev/ic/mpi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpi.c,v 1.63 2006/07/15 04:09:57 dlg Exp $ */
+/* $OpenBSD: mpi.c,v 1.64 2006/08/03 08:48:44 dlg Exp $ */
/*
* Copyright (c) 2005, 2006 David Gwynne <dlg@openbsd.org>
@@ -1103,7 +1103,9 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
xs->sense.flags = SKEY_ILLEGAL_REQUEST;
xs->sense.add_sense_code = 0x20;
xs->error = XS_SENSE;
+ s = splbio();
scsi_done(xs);
+ splx(s);
return (COMPLETE);
}
@@ -1112,7 +1114,9 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
splx(s);
if (ccb == NULL) {
xs->error = XS_DRIVER_STUFFUP;
+ s = splbio();
scsi_done(xs);
+ splx(s);
return (COMPLETE);
}
DNPRINTF(MPI_D_CMD, "%s: ccb_id: %d xs->flags: 0x%x\n",
@@ -1164,11 +1168,11 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
((u_int8_t *)&mcb->mcb_sense - (u_int8_t *)mcb));
if (mpi_load_xs(ccb) != 0) {
+ xs->error = XS_DRIVER_STUFFUP;
s = splbio();
mpi_put_ccb(sc, ccb);
- splx(s);
- xs->error = XS_DRIVER_STUFFUP;
scsi_done(xs);
+ splx(s);
return (COMPLETE);
}
@@ -1180,7 +1184,9 @@ mpi_scsi_cmd(struct scsi_xfer *xs)
return (COMPLETE);
}
+ s = splbio();
mpi_start(sc, ccb);
+ splx(s);
return (SUCCESSFULLY_QUEUED);
}
@@ -2009,7 +2015,6 @@ mpi_eventnotify(struct mpi_softc *sc)
enq->msg_context = htole32(ccb->ccb_id);
mpi_start(sc, ccb);
-
return (0);
}