summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2010-06-03 11:37:46 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2010-06-03 11:37:46 +0000
commit6e139b680703a80555474e102e558c0d90c8fb22 (patch)
tree2b1ef4a82c9e37180e9df805e506287a9e9fb41b /sys
parentce60163338a283580f759f8171795398b82a524b (diff)
Always initialize the ccb provided by the scsi layer into the proper
state when starting an i/o. Necessary as the scsi layer may now re-submit a completed xs/ccb to the adapter in some error situations. Fixes panics seen by various people, reproduced and fix tested by sobrado@. ok dlg@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/siop.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/ic/siop.c b/sys/dev/ic/siop.c
index 003ba4ad743..89185a69dbf 100644
--- a/sys/dev/ic/siop.c
+++ b/sys/dev/ic/siop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: siop.c,v 1.58 2010/04/06 01:12:17 dlg Exp $ */
+/* $OpenBSD: siop.c,v 1.59 2010/06/03 11:37:45 krw Exp $ */
/* $NetBSD: siop.c,v 1.79 2005/11/18 23:10:32 bouyer Exp $ */
/*
@@ -1467,6 +1467,12 @@ siop_scsicmd(xs)
siop_cmd = xs->io;
+ /*
+ * The xs may have been restarted by the scsi layer, so ensure the ccb
+ * starts in the proper state.
+ */
+ siop_cmd->cmd_c.status = CMDST_READY;
+
/* Always reset xs->stimeout, lest we timeout_del() with trash */
timeout_set(&xs->stimeout, siop_timeout, siop_cmd);