aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/ctl
diff options
context:
space:
mode:
authorAlexander Motin <mav@FreeBSD.org>2022-01-07 19:30:44 +0000
committerAlexander Motin <mav@FreeBSD.org>2022-01-21 01:59:34 +0000
commit9a45d88946629e2fbebe7deb9f74204e455a0364 (patch)
tree4b5bc52aac2821d73afffd8180158d52b3ae5258 /sys/cam/ctl
parentd1bc23490194bd5a441b26fa1409717c267861f0 (diff)
CTL: Relax callouts precisions.
MFC after: 2 weeks (cherry picked from commit f4d499fd670283ee09f8870088c1b394843ae468)
Diffstat (limited to 'sys/cam/ctl')
-rw-r--r--sys/cam/ctl/ctl.c7
-rw-r--r--sys/cam/ctl/ctl_tpc.c5
2 files changed, 7 insertions, 5 deletions
diff --git a/sys/cam/ctl/ctl.c b/sys/cam/ctl/ctl.c
index 980328c1551f..47176a5cb981 100644
--- a/sys/cam/ctl/ctl.c
+++ b/sys/cam/ctl/ctl.c
@@ -5903,7 +5903,8 @@ ctl_ie_timer(void *arg)
t = scsi_4btoul(lun->MODE_IE.interval_timer);
if (t == 0 || t == UINT32_MAX)
t = 3000; /* 5 min */
- callout_schedule(&lun->ie_callout, t * hz / 10);
+ callout_schedule(&lun->ie_callout, SBT_1S / 10 * t,
+ SBT_1S / 10, 0);
}
}
@@ -5935,8 +5936,8 @@ ctl_ie_page_handler(struct ctl_scsiio *ctsio,
t = scsi_4btoul(pg->interval_timer);
if (t == 0 || t == UINT32_MAX)
t = 3000; /* 5 min */
- callout_reset(&lun->ie_callout, t * hz / 10,
- ctl_ie_timer, lun);
+ callout_reset_sbt(&lun->ie_callout, SBT_1S / 10 * t,
+ SBT_1S / 10, ctl_ie_timer, lun, 0);
}
} else {
lun->ie_asc = 0;
diff --git a/sys/cam/ctl/ctl_tpc.c b/sys/cam/ctl/ctl_tpc.c
index 60cd5611643d..66ac2a1023e9 100644
--- a/sys/cam/ctl/ctl_tpc.c
+++ b/sys/cam/ctl/ctl_tpc.c
@@ -187,7 +187,7 @@ tpc_timeout(void *arg)
free(token, M_CTL);
}
mtx_unlock(&softc->tpc_lock);
- callout_schedule(&softc->tpc_timeout, hz);
+ callout_schedule_sbt(&softc->tpc_timeout, SBT_1S, SBT_1S, 0);
}
void
@@ -197,7 +197,8 @@ ctl_tpc_init(struct ctl_softc *softc)
mtx_init(&softc->tpc_lock, "CTL TPC mutex", NULL, MTX_DEF);
TAILQ_INIT(&softc->tpc_tokens);
callout_init_mtx(&softc->tpc_timeout, &softc->ctl_lock, 0);
- callout_reset(&softc->tpc_timeout, hz, tpc_timeout, softc);
+ callout_reset_sbt(&softc->tpc_timeout, SBT_1S, SBT_1S,
+ tpc_timeout, softc, 0);
}
void