diff options
author | scottl <scottl@FreeBSD.org> | 2007-08-14 19:17:35 +0000 |
---|---|---|
committer | scottl <scottl@FreeBSD.org> | 2007-08-14 19:17:35 +0000 |
commit | 6a5876744b6ff150398bd1ceed41c8c55100e21c (patch) | |
tree | 307e1331fbfde3f1e746330593c156f5631b41f4 /sys | |
parent | 77bdf661bd314348756346e22a3a8815b2c00430 (diff) | |
download | FreeBSD-src-6a5876744b6ff150398bd1ceed41c8c55100e21c.zip FreeBSD-src-6a5876744b6ff150398bd1ceed41c8c55100e21c.tar.gz |
Move callout initialization to the proper spot. This prevents panics during
error recovery.
Approved by: re
Found by: kan
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/mpt/mpt.c | 1 | ||||
-rw-r--r-- | sys/dev/mpt/mpt.h | 4 | ||||
-rw-r--r-- | sys/dev/mpt/mpt_cam.c | 4 |
3 files changed, 1 insertions, 8 deletions
diff --git a/sys/dev/mpt/mpt.c b/sys/dev/mpt/mpt.c index d186c85..2cd6a2f 100644 --- a/sys/dev/mpt/mpt.c +++ b/sys/dev/mpt/mpt.c @@ -1237,6 +1237,7 @@ retry: req->state = REQ_STATE_ALLOCATED; req->chain = NULL; mpt_assign_serno(mpt, req); + mpt_callout_init(&req->callout); } else if (sleep_ok != 0) { mpt->getreqwaiter = 1; mpt_sleep(mpt, &mpt->request_free_list, PUSER, "mptgreq", 0); diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h index 52dbf1c..c8fb76c 100644 --- a/sys/dev/mpt/mpt.h +++ b/sys/dev/mpt/mpt.h @@ -844,8 +844,6 @@ mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) -#define mpt_req_timeout_init(req) \ - callout_init(&(req)->callout) #else #if 1 @@ -871,8 +869,6 @@ mpt_sleep(struct mpt_softc *mpt, void *ident, int priority, callout_reset(&(req)->callout, (ticks), (func), (arg)); #define mpt_req_untimeout(req, func, arg) \ callout_stop(&(req)->callout) -#define mpt_req_timeout_init(req) \ - callout_init(&(req)->callout, 1) #else diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c index 1a1246a..18aab4c 100644 --- a/sys/dev/mpt/mpt_cam.c +++ b/sys/dev/mpt/mpt_cam.c @@ -1636,8 +1636,6 @@ out: if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000, mpt_timeout, ccb); - } else { - mpt_req_timeout_init(req); } if (mpt->verbose > MPT_PRT_DEBUG) { int nc = 0; @@ -2037,8 +2035,6 @@ out: if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) { mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000, mpt_timeout, ccb); - } else { - mpt_req_timeout_init(req); } if (mpt->verbose > MPT_PRT_DEBUG) { int nc = 0; |