Move callout initialization to the proper spot. This prevents panics during
error recovery. Approved by: re Found by: kan
This commit is contained in:
parent
83b4953255
commit
9adc3a2dfb
@ -1237,6 +1237,7 @@ mpt_get_request(struct mpt_softc *mpt, int sleep_ok)
|
||||
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);
|
||||
|
@ -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
|
||||
|
||||
|
@ -1636,8 +1636,6 @@ mpt_execute_req_a64(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
|
||||
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 @@ mpt_execute_req(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user