From 6e139b680703a80555474e102e558c0d90c8fb22 Mon Sep 17 00:00:00 2001 From: Kenneth R Westerback Date: Thu, 3 Jun 2010 11:37:46 +0000 Subject: 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@ --- sys/dev/ic/siop.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys') 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); -- cgit v1.2.3