diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-24 19:48:51 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-09-24 19:48:51 +0000 |
commit | 14d77f46fc629260ec2fdda007d61c5eea2d07cd (patch) | |
tree | 77c533e95d61299902eb355d444c0ff9e35aa3c1 | |
parent | f76f1e87edb6b0ef8a323123282cf3a448b44799 (diff) |
Make sure the scsi_xfer timeout always get initialized with timeout_set(),
since the scsi_done() wrapper will timeout_del() unconditionnaly and the
scsi midlayer no longer provides scsi_xfer with zeroed struct timeout.
ok dlg@
-rw-r--r-- | sys/dev/isa/seagate.c | 8 | ||||
-rw-r--r-- | sys/dev/isa/wds.c | 7 |
2 files changed, 6 insertions, 9 deletions
diff --git a/sys/dev/isa/seagate.c b/sys/dev/isa/seagate.c index f6b124b87a9..d6430a2d2cb 100644 --- a/sys/dev/isa/seagate.c +++ b/sys/dev/isa/seagate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: seagate.c,v 1.29 2009/09/05 11:49:36 dlg Exp $ */ +/* $OpenBSD: seagate.c,v 1.30 2009/09/24 19:48:50 miod Exp $ */ /* * ST01/02, Future Domain TMC-885, TMC-950 SCSI driver @@ -553,6 +553,7 @@ sea_scsi_cmd(struct scsi_xfer *xs) } scb->flags = SCB_ACTIVE; scb->xs = xs; + timeout_set(&scb->xs->stimeout, sea_timeout, scb); if (flags & SCSI_RESET) { /* @@ -585,7 +586,6 @@ sea_scsi_cmd(struct scsi_xfer *xs) * Usually return SUCCESSFULLY QUEUED */ if ((flags & SCSI_POLL) == 0) { - timeout_set(&scb->xs->stimeout, sea_timeout, scb); timeout_add_msec(&scb->xs->stimeout, xs->timeout); splx(s); return SUCCESSFULLY_QUEUED; @@ -814,10 +814,8 @@ sea_timeout(void *arg) scb->flags |= SCB_ABORTED; sea_abort(sea, scb); /* 2 secs for the abort */ - if ((xs->flags & SCSI_POLL) == 0) { - timeout_set(&scb->xs->stimeout, sea_timeout, scb); + if ((xs->flags & SCSI_POLL) == 0) timeout_add_sec(&scb->xs->stimeout, 2); - } } splx(s); diff --git a/sys/dev/isa/wds.c b/sys/dev/isa/wds.c index 8f54af62d69..57f4b06061f 100644 --- a/sys/dev/isa/wds.c +++ b/sys/dev/isa/wds.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wds.c,v 1.30 2009/09/05 11:49:36 dlg Exp $ */ +/* $OpenBSD: wds.c,v 1.31 2009/09/24 19:48:50 miod Exp $ */ /* $NetBSD: wds.c,v 1.13 1996/11/03 16:20:31 mycroft Exp $ */ #undef WDSDIAG @@ -716,6 +716,7 @@ wds_start_scbs(sc) #ifdef WDSDIAG scb->flags |= SCB_SENDING; #endif + timeout_set(&scb->xs->stimeout, wds_timeout, scb); /* Link scb to mbo. */ #ifdef notyet @@ -735,10 +736,8 @@ wds_start_scbs(sc) c = WDSC_MSTART(wmbo - wmbx->mbo); wds_cmd(sc, &c, sizeof c); - if ((scb->flags & SCB_POLLED) == 0) { - timeout_set(&scb->xs->stimeout, wds_timeout, scb); + if ((scb->flags & SCB_POLLED) == 0) timeout_add_msec(&scb->xs->stimeout, scb->timeout); - } ++sc->sc_mbofull; wds_nextmbx(wmbo, wmbx, mbo); |