summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordlg <dlg@openbsd.org>2010-06-02 13:32:13 +0000
committerdlg <dlg@openbsd.org>2010-06-02 13:32:13 +0000
commitef4d51a9d6defe1de440e646ea8b3a17ad7bdbd6 (patch)
tree89df1cb6d6dbab2e2d90c79f5de7406518dc0bf8
parentAvoid using and end pointer since strnlen(string, -1) is legal (diff)
downloadwireguard-openbsd-ef4d51a9d6defe1de440e646ea8b3a17ad7bdbd6.tar.xz
wireguard-openbsd-ef4d51a9d6defe1de440e646ea8b3a17ad7bdbd6.zip
bring back the SDF_WAITING waiting flag while adapters still implement
NO_CCB. if sd_buf_done is told that the adapter has no more ccbs via NO_CCB, this sets a flag so sdstart doesnt try and queue more io straight away. this fixes the lockups on ciss that halex and okan were experiencing after the iopools code went in. it will fix any other hba that returns NO_CCB too. tested by me@, okan@, and halex@ ok krw@ okan@ halex@
-rw-r--r--sys/scsi/sd.c7
-rw-r--r--sys/scsi/sdvar.h3
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c
index d2bc296b27e..0c72b47ccbf 100644
--- a/sys/scsi/sd.c
+++ b/sys/scsi/sd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sd.c,v 1.191 2010/05/26 16:38:20 thib Exp $ */
+/* $OpenBSD: sd.c,v 1.192 2010/06/02 13:32:13 dlg Exp $ */
/* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */
/*-
@@ -718,7 +718,9 @@ sdstart(struct scsi_xfer *xs)
scsi_xs_exec(xs);
/* move onto the next io */
- if (BUFQ_PEEK(sc->sc_bufq) != NULL)
+ if (ISSET(sc->flags, SDF_WAITING))
+ CLR(sc->flags, SDF_WAITING);
+ else if (BUFQ_PEEK(sc->sc_bufq) != NULL)
scsi_xsh_add(&sc->sc_xsh);
}
@@ -741,6 +743,7 @@ sd_buf_done(struct scsi_xfer *xs)
bp->b_flags & B_READ);
BUFQ_REQUEUE(sc->sc_bufq, bp);
scsi_xs_put(xs);
+ SET(sc->flags, SDF_WAITING);
timeout_add(&sc->sc_timeout, 1);
return;
diff --git a/sys/scsi/sdvar.h b/sys/scsi/sdvar.h
index 396b1cd1da9..d5debe6a498 100644
--- a/sys/scsi/sdvar.h
+++ b/sys/scsi/sdvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: sdvar.h,v 1.30 2010/05/26 16:38:20 thib Exp $ */
+/* $OpenBSD: sdvar.h,v 1.31 2010/06/02 13:32:13 dlg Exp $ */
/* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */
/*-
@@ -61,6 +61,7 @@ struct sd_softc {
#define SDF_ANCIENT 0x10 /* disk is ancient; for minphys */
#define SDF_DIRTY 0x20 /* disk is dirty; needs cache flush */
#define SDF_DYING 0x40 /* dying, when deactivated */
+#define SDF_WAITING 0x80
struct scsi_link *sc_link; /* contains our targ, lun, etc. */
struct disk_parms {
u_long heads; /* number of heads */