From c351a6ec918ea33e2abdc012deeb7b77d3a90e5f Mon Sep 17 00:00:00 2001 From: Warner Losh Date: Tue, 28 Nov 2023 18:49:24 -0700 Subject: [PATCH] mpi3mr: Only set callout_owned when we create a timeout Since we assume there's a timeout to cancel when this is true, only set it true when we set the timeout. Otherwise we may try to cancel a timeout when there's been an error in submission. Sponsored by: Netflix Reviewed by: mav Differential Revision: https://reviews.freebsd.org/D42541 (cherry picked from commit 1cfd01111eb6a28ca5043e928aa8e9099064177a) --- sys/dev/mpi3mr/mpi3mr_cam.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/mpi3mr/mpi3mr_cam.c b/sys/dev/mpi3mr/mpi3mr_cam.c index 9b85ee8301d..44b613ad791 100644 --- a/sys/dev/mpi3mr/mpi3mr_cam.c +++ b/sys/dev/mpi3mr/mpi3mr_cam.c @@ -1223,15 +1223,15 @@ mpi3mr_action_scsiio(struct mpi3mr_cam_softc *cam_sc, union ccb *ccb) mpi3mr_set_ccbstatus(ccb, CAM_RESRC_UNAVAIL); xpt_done(ccb); } else { - callout_reset_sbt(&cm->callout, SBT_1S * 90 , 0, - mpi3mr_scsiio_timeout, cm, 0); + callout_reset_sbt(&cm->callout, mstosbt(ccb->ccb_h.timeout), 0, + mpi3mr_scsiio_timeout, cm, 0); + cm->callout_owner = true; mpi3mr_atomic_inc(&sc->fw_outstanding); mpi3mr_atomic_inc(&targ->outstanding); if (mpi3mr_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater) sc->io_cmds_highwater++; } - cm->callout_owner = true; return; }