Apply by doing: /usr/src patch -p0 < 007_scsi.patch Then build and install a new kernel. Index: sys/scsi/scsi_base.c =================================================================== RCS file: /cvs/src/sys/scsi/scsi_base.c,v retrieving revision 1.166 retrieving revision 1.166.2.1 diff -u -r1.166 -r1.166.2.1 --- sys/scsi/scsi_base.c 15 Jan 2010 06:27:12 -0000 1.166 +++ sys/scsi/scsi_base.c 24 Aug 2010 09:10:14 -0000 1.166.2.1 @@ -1,4 +1,4 @@ -/* $OpenBSD: scsi_base.c,v 1.166 2010/01/15 06:27:12 krw Exp $ */ +/* $OpenBSD: scsi_base.c,v 1.166.2.1 2010/08/24 09:10:14 stephan Exp $ */ /* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */ /* @@ -723,6 +723,7 @@ xs->error = XS_NOERROR; xs->resid = xs->datalen; xs->status = 0; + CLR(xs->flags, ITSDONE); #ifdef SCSIDEBUG if (xs->sc_link->flags & SDEV_DB1) { Index: sys/dev/ic/gdt_common.c =================================================================== RCS file: /cvs/src/sys/dev/ic/gdt_common.c,v retrieving revision 1.47 retrieving revision 1.47.2.1 diff -u -r1.47 -r1.47.2.1 --- sys/dev/ic/gdt_common.c 9 Jan 2010 23:15:06 -0000 1.47 +++ sys/dev/ic/gdt_common.c 19 Aug 2010 10:48:53 -0000 1.47.2.1 @@ -1,4 +1,4 @@ -/* $OpenBSD: gdt_common.c,v 1.47 2010/01/09 23:15:06 krw Exp $ */ +/* $OpenBSD: gdt_common.c,v 1.47.2.1 2010/08/19 10:48:53 stephan Exp $ */ /* * Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved. @@ -593,6 +593,7 @@ bus_dmamap_t xfer; int error, retval = SUCCESSFULLY_QUEUED; int s; + int polled; GDT_DPRINTF(GDT_D_CMD, ("gdt_scsi_cmd ")); @@ -621,6 +622,7 @@ ccb = NULL; link = xs->sc_link; target = link->target; + polled = ISSET(xs->flags, SCSI_POLL); if (!gdt_polling && !(xs->flags & SCSI_POLL) && sc->sc_test_busy(sc)) { @@ -759,7 +761,6 @@ ccb->gc_cmd_index); return (NO_CCB); } - scsi_done(xs); } } @@ -767,7 +768,7 @@ /* * Don't process the queue if we are polling. */ - if (xs->flags & SCSI_POLL) { + if (polled) { retval = COMPLETE; break; } @@ -1093,7 +1094,7 @@ struct gdt_intr_ctx ctx; int chain = 1; int sync_val = 0; - struct scsi_xfer *xs; + struct scsi_xfer *xs = NULL; int prev_cmd; struct gdt_ccb *ccb; @@ -1165,6 +1166,10 @@ finish: switch (sync_val) { + case 0: + if (xs && gdt_from_wait) + scsi_done(xs); + break; case 1: scsi_done(xs); break;