diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-18 19:17:01 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-18 19:17:01 +0000 |
commit | df7fe57724d56e279b04309ded1308122b0159d7 (patch) | |
tree | be4e47c09c53863c9576666577beb9f9889276d5 /sys/arch/hp300 | |
parent | a83f674b64360601c865cc72ae945177225198a2 (diff) |
Make sure to always initialize the scsi_xfer timeout with timeout_set() early
in spc_scsi_cmd(), so that it is safe to pass it to timeout_del() anytime
(recent scsi changes no longer cause the scsi_xfer timeout to be in an
initialized state).
Diffstat (limited to 'sys/arch/hp300')
-rw-r--r-- | sys/arch/hp300/dev/mb89352.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/arch/hp300/dev/mb89352.c b/sys/arch/hp300/dev/mb89352.c index 1487cefbbb2..6b8d0816ee3 100644 --- a/sys/arch/hp300/dev/mb89352.c +++ b/sys/arch/hp300/dev/mb89352.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mb89352.c,v 1.18 2009/07/23 21:10:37 blambert Exp $ */ +/* $OpenBSD: mb89352.c,v 1.19 2009/09/18 19:16:59 miod Exp $ */ /* $NetBSD: mb89352.c,v 1.5 2000/03/23 07:01:31 thorpej Exp $ */ /* NecBSD: mb89352.c,v 1.4 1998/03/14 07:31:20 kmatsuda Exp */ @@ -418,6 +418,7 @@ spc_scsi_cmd(struct scsi_xfer *xs) /* Initialize acb */ acb->xs = xs; acb->timeout = xs->timeout; + timeout_set(&xs->stimeout, spc_timeout, acb); if (xs->flags & SCSI_RESET) { acb->flags |= ACB_RESET; @@ -1619,12 +1620,9 @@ start: sc->sc_cleft = acb->scsi_cmd_length; /* On our first connection, schedule a timeout. */ - if ((acb->xs->flags & SCSI_POLL) == 0) { - timeout_set(&acb->xs->stimeout, spc_timeout, - acb); + if ((acb->xs->flags & SCSI_POLL) == 0) timeout_add_msec(&acb->xs->stimeout, acb->timeout); - } sc->sc_state = SPC_CONNECTED; } else if ((ints & INTS_TIMEOUT) != 0) { SPC_MISC(("selection timeout ")); |