summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2010-06-02 05:07:59 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2010-06-02 05:07:59 +0000
commit6542d9b0585d80e83fd1ad58524389c6f819ef30 (patch)
treed6d010dc05e0001fbed399c61bc0688d48135266
parent420a3b77c8708d7460c19ed049e53232ccff4787 (diff)
call scsi_done before put_ccb, rather than have put_ccb call scsi_done
for us.
-rw-r--r--sys/dev/ic/ciss.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/sys/dev/ic/ciss.c b/sys/dev/ic/ciss.c
index c51b3ce8fcd..0a01b5efee5 100644
--- a/sys/dev/ic/ciss.c
+++ b/sys/dev/ic/ciss.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ciss.c,v 1.48 2010/06/02 01:45:14 dlg Exp $ */
+/* $OpenBSD: ciss.c,v 1.49 2010/06/02 05:07:58 dlg Exp $ */
/*
* Copyright (c) 2005,2006 Michael Shalayeff
@@ -128,11 +128,6 @@ ciss_put_ccb(struct ciss_ccb *ccb)
{
struct ciss_softc *sc = ccb->ccb_sc;
- if (ccb->ccb_xs) {
- CISS_DPRINTF(CISS_D_CMD, ("scsi_done(%p) ", ccb->ccb_xs));
- scsi_done(ccb->ccb_xs);
- }
-
ccb->ccb_state = CISS_CCB_FREE;
ccb->ccb_xs = NULL;
ccb->ccb_data = NULL;
@@ -489,8 +484,10 @@ ciss_cmd(struct ciss_ccb *ccb, int flags, int wait)
printf("more than %d dma segs\n", sc->maxsg);
else
printf("error %d loading dma map\n", error);
- if (ccb->ccb_xs)
+ if (ccb->ccb_xs) {
ccb->ccb_xs->error = XS_DRIVER_STUFFUP;
+ scsi_done(ccb->ccb_xs);
+ }
ciss_put_ccb(ccb);
return (error);
}
@@ -662,8 +659,10 @@ ciss_done(struct ciss_ccb *ccb)
bus_dmamap_unload(sc->dmat, ccb->ccb_dmamap);
}
- if (xs)
+ if (xs) {
xs->resid = 0;
+ scsi_done(ccb->ccb_xs);
+ }
ciss_put_ccb(ccb);