summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/cam/cam_xpt.c10
-rw-r--r--sys/dev/advansys/advansys.c10
-rw-r--r--sys/dev/advansys/adwcam.c4
-rw-r--r--sys/dev/aha/aha.c10
-rw-r--r--sys/dev/ahb/ahb.c10
-rw-r--r--sys/dev/ahci/ahci.c16
-rw-r--r--sys/dev/aic/aic.c16
-rw-r--r--sys/dev/arcmsr/arcmsr.c4
-rw-r--r--sys/dev/asr/asr.c49
-rw-r--r--sys/dev/buslogic/bt.c10
-rw-r--r--sys/dev/ciss/ciss.c3
-rw-r--r--sys/dev/dpt/dpt_scsi.c4
-rw-r--r--sys/dev/firewire/sbp.c14
-rw-r--r--sys/dev/glxiic/glxiic.c4
-rw-r--r--sys/dev/hpt27xx/hpt27xx_os_bsd.c4
-rw-r--r--sys/dev/hptnr/hptnr_os_bsd.c4
-rw-r--r--sys/dev/hptrr/hptrr_os_bsd.c4
-rw-r--r--sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c11
-rw-r--r--sys/dev/iir/iir.c6
-rw-r--r--sys/dev/isci/isci_io_request.c10
-rw-r--r--sys/dev/isci/isci_timer.c4
-rw-r--r--sys/dev/mpr/mpr_sas.c4
-rw-r--r--sys/dev/mps/mps_sas.c4
-rw-r--r--sys/dev/mpt/mpt.c14
-rw-r--r--sys/dev/mpt/mpt.h8
-rw-r--r--sys/dev/mpt/mpt_cam.c6
-rw-r--r--sys/dev/mrsas/mrsas_cam.c8
-rw-r--r--sys/dev/mvs/mvs.c14
-rw-r--r--sys/dev/siis/siis.c10
-rw-r--r--sys/dev/sym/sym_hipd.c4
-rw-r--r--sys/dev/trm/trm.c4
-rw-r--r--sys/dev/tws/tws_cam.c3
-rw-r--r--sys/dev/virtio/scsi/virtio_scsi.c4
33 files changed, 146 insertions, 144 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 6a7218f..e8b45e0 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -2904,9 +2904,9 @@ call_sim:
start_ccb->ccb_h.flags |= CAM_DEV_QFREEZE;
}
- callout_reset(&dev->callout,
- (crs->release_timeout * hz) / 1000,
- xpt_release_devq_timeout, dev);
+ callout_reset_sbt(&dev->callout,
+ SBT_1MS * crs->release_timeout, 0,
+ xpt_release_devq_timeout, dev, 0);
dev->flags |= CAM_DEV_REL_TIMEOUT_PENDING;
@@ -4955,8 +4955,8 @@ xpt_config(void *arg)
periphdriver_init(1);
xpt_hold_boot();
callout_init(&xsoftc.boot_callout, 1);
- callout_reset(&xsoftc.boot_callout, hz * xsoftc.boot_delay / 1000,
- xpt_boot_delay, NULL);
+ callout_reset_sbt(&xsoftc.boot_callout, SBT_1MS * xsoftc.boot_delay, 0,
+ xpt_boot_delay, NULL, 0);
/* Fire up rescan thread. */
if (kproc_kthread_add(xpt_scanner_thread, NULL, &cam_proc, NULL, 0, 0,
"cam", "scanner")) {
diff --git a/sys/dev/advansys/advansys.c b/sys/dev/advansys/advansys.c
index c9ccb67..6f2f7a5 100644
--- a/sys/dev/advansys/advansys.c
+++ b/sys/dev/advansys/advansys.c
@@ -168,9 +168,9 @@ adv_clear_state_really(struct adv_softc *adv, union ccb* ccb)
ccb_h = LIST_FIRST(&adv->pending_ccbs);
while (ccb_h != NULL) {
cinfo = ccb_h->ccb_cinfo_ptr;
- callout_reset(&cinfo->timer,
- ccb_h->timeout * hz / 1000, adv_timeout,
- ccb_h);
+ callout_reset_sbt(&cinfo->timer,
+ SBT_1MS * ccb_h->timeout, 0,
+ adv_timeout, ccb_h, 0);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
adv->state &= ~ADV_IN_TIMEOUT;
@@ -569,8 +569,8 @@ adv_execute_ccb(void *arg, bus_dma_segment_t *dm_segs,
ccb_h->status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&adv->pending_ccbs, ccb_h, sim_links.le);
/* Schedule our timeout */
- callout_reset(&cinfo->timer, ccb_h->timeout * hz /1000, adv_timeout,
- csio);
+ callout_reset_sbt(&cinfo->timer, SBT_1MS * ccb_h->timeout, 0,
+ adv_timeout, csio, 0);
}
static struct adv_ccb_info *
diff --git a/sys/dev/advansys/adwcam.c b/sys/dev/advansys/adwcam.c
index 875813b..5b49af5 100644
--- a/sys/dev/advansys/adwcam.c
+++ b/sys/dev/advansys/adwcam.c
@@ -322,8 +322,8 @@ adwexecuteacb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
acb->state |= ACB_ACTIVE;
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&adw->pending_ccbs, &ccb->ccb_h, sim_links.le);
- callout_reset(&acb->timer, (ccb->ccb_h.timeout * hz) / 1000,
- adwtimeout, acb);
+ callout_reset_sbt(&acb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ adwtimeout, acb, 0);
adw_send_acb(adw, acb, acbvtob(adw, acb));
}
diff --git a/sys/dev/aha/aha.c b/sys/dev/aha/aha.c
index 4efbb32..d3f1f5d 100644
--- a/sys/dev/aha/aha.c
+++ b/sys/dev/aha/aha.c
@@ -1049,8 +1049,8 @@ ahaexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&aha->pending_ccbs, &ccb->ccb_h, sim_links.le);
- callout_reset(&accb->timer, (ccb->ccb_h.timeout * hz) / 1000,
- ahatimeout, accb);
+ callout_reset_sbt(&accb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ ahatimeout, accb, 0);
/* Tell the adapter about this command */
if (aha->cur_outbox->action_code != AMBO_FREE) {
@@ -1183,9 +1183,9 @@ ahadone(struct aha_softc *aha, struct aha_ccb *accb, aha_mbi_comp_code_t comp_co
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
ahadone(aha, pending_accb, AMBI_ERROR);
} else {
- callout_reset(&pending_accb->timer,
- (ccb_h->timeout * hz) / 1000,
- ahatimeout, pending_accb);
+ callout_reset_sbt(&pending_accb->timer,
+ SBT_1MS * ccb_h->timeout, 0, ahatimeout,
+ pending_accb, 0);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
}
diff --git a/sys/dev/ahb/ahb.c b/sys/dev/ahb/ahb.c
index fd07c44..55cc351 100644
--- a/sys/dev/ahb/ahb.c
+++ b/sys/dev/ahb/ahb.c
@@ -617,9 +617,9 @@ ahbhandleimmed(struct ahb_softc *ahb, u_int32_t mbox, u_int intstat)
xpt_done(ccb);
} else if (ahb->immed_ecb != NULL) {
/* Re-instate timeout */
- callout_reset(&pending_ecb->timer,
- (ccb->ccb_h.timeout * hz) / 1000,
- ahbtimeout, pending_ecb);
+ callout_reset_sbt(&pending_ecb->timer,
+ SBT_1MS * ccb->ccb_h.timeout, 0, ahbtimeout,
+ pending_ecb, 0);
}
}
@@ -986,8 +986,8 @@ ahbexecuteecb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
/* Tell the adapter about this command */
ahbqueuembox(ahb, ecb_paddr, ATTN_STARTECB|ccb->ccb_h.target_id);
- callout_reset(&ecb->timer, (ccb->ccb_h.timeout * hz) / 1000, ahbtimeout,
- ecb);
+ callout_reset_sbt(&ecb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ ahbtimeout, ecb, 0);
}
static void
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c
index f9ef0b7..ce54c77 100644
--- a/sys/dev/ahci/ahci.c
+++ b/sys/dev/ahci/ahci.c
@@ -2033,8 +2033,8 @@ ahci_execute_transaction(struct ahci_slot *slot)
return;
}
/* Start command execution timeout */
- callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 2000,
- (timeout_t*)ahci_timeout, slot);
+ callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout / 2,
+ 0, (timeout_t*)ahci_timeout, slot, 0);
return;
}
@@ -2071,9 +2071,9 @@ ahci_rearm_timeout(device_t dev)
continue;
if ((ch->toslots & (1 << i)) == 0)
continue;
- callout_reset(&slot->timeout,
- (int)slot->ccb->ccb_h.timeout * hz / 2000,
- (timeout_t*)ahci_timeout, slot);
+ callout_reset_sbt(&slot->timeout,
+ SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
+ (timeout_t*)ahci_timeout, slot, 0);
}
}
@@ -2105,9 +2105,9 @@ ahci_timeout(struct ahci_slot *slot)
slot->state = AHCI_SLOT_EXECUTING;
}
- callout_reset(&slot->timeout,
- (int)slot->ccb->ccb_h.timeout * hz / 2000,
- (timeout_t*)ahci_timeout, slot);
+ callout_reset_sbt(&slot->timeout,
+ SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
+ (timeout_t*)ahci_timeout, slot, 0);
return;
}
diff --git a/sys/dev/aic/aic.c b/sys/dev/aic/aic.c
index d751b4d..7d4e1ef 100644
--- a/sys/dev/aic/aic.c
+++ b/sys/dev/aic/aic.c
@@ -319,8 +319,8 @@ aic_execute_scb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
ccb->ccb_h.status |= CAM_SIM_QUEUED;
TAILQ_INSERT_TAIL(&aic->pending_ccbs, &ccb->ccb_h, sim_links.tqe);
- callout_reset(&scb->timer, (ccb->ccb_h.timeout * hz) / 1000,
- aic_timeout, scb);
+ callout_reset_sbt(&scb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ aic_timeout, scb, 0);
aic_start(aic);
}
@@ -1075,9 +1075,9 @@ aic_done(struct aic_softc *aic, struct aic_scb *scb)
&pending_scb->ccb->ccb_h, sim_links.tqe);
aic_done(aic, pending_scb);
} else {
- callout_reset(&pending_scb->timer,
- (ccb_h->timeout * hz) / 1000, aic_timeout,
- pending_scb);
+ callout_reset_sbt(&pending_scb->timer,
+ SBT_1MS * ccb_h->timeout, 0, aic_timeout,
+ pending_scb, 0);
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe);
}
}
@@ -1094,9 +1094,9 @@ aic_done(struct aic_softc *aic, struct aic_scb *scb)
&nexus_scb->ccb->ccb_h, sim_links.tqe);
aic_done(aic, nexus_scb);
} else {
- callout_reset(&nexus_scb->timer,
- (ccb_h->timeout * hz) / 1000, aic_timeout,
- nexus_scb);
+ callout_reset_sbt(&nexus_scb->timer,
+ SBT_1MS * ccb_h->timeout, 0, aic_timeout,
+ nexus_scb, 0);
ccb_h = TAILQ_NEXT(ccb_h, sim_links.tqe);
}
}
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c
index 727e0aa..5d46ad3 100644
--- a/sys/dev/arcmsr/arcmsr.c
+++ b/sys/dev/arcmsr/arcmsr.c
@@ -2703,7 +2703,9 @@ static void arcmsr_execute_srb(void *arg, bus_dma_segment_t *dm_segs, int nseg,
if (pccb->ccb_h.timeout != CAM_TIME_INFINITY)
{
arcmsr_callout_init(&srb->ccb_callout);
- callout_reset(&srb->ccb_callout, ((pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)) * hz) / 1000, arcmsr_srb_timeout, srb);
+ callout_reset_sbt(&srb->ccb_callout, SBT_1MS *
+ (pccb->ccb_h.timeout + (ARCMSR_TIMEOUT_DELAY * 1000)), 0,
+ arcmsr_srb_timeout, srb, 0);
srb->srb_flags |= SRB_FLAG_TIMER_START;
}
}
diff --git a/sys/dev/asr/asr.c b/sys/dev/asr/asr.c
index 1e4f1a6..f603f10 100644
--- a/sys/dev/asr/asr.c
+++ b/sys/dev/asr/asr.c
@@ -384,22 +384,6 @@ typedef struct Asr_softc {
static STAILQ_HEAD(, Asr_softc) Asr_softc_list =
STAILQ_HEAD_INITIALIZER(Asr_softc_list);
-
-static __inline void
-set_ccb_timeout_ch(union asr_ccb *ccb, struct callout_handle ch)
-{
- ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout;
-}
-
-static __inline struct callout_handle
-get_ccb_timeout_ch(union asr_ccb *ccb)
-{
- struct callout_handle ch;
-
- ch.callout = ccb->ccb_h.sim_priv.entries[0].ptr;
- return ch;
-}
-
/*
* Prototypes of the routines we have in this object.
*/
@@ -422,6 +406,25 @@ static void asr_action(struct cam_sim *sim, union ccb *ccb);
static void asr_poll(struct cam_sim *sim);
static int ASR_queue(Asr_softc_t *sc, PI2O_MESSAGE_FRAME Message);
+static __inline void
+set_ccb_timeout_ch(union asr_ccb *ccb)
+{
+ struct callout_handle ch;
+
+ ch = timeout(asr_timeout, (caddr_t)ccb,
+ (int)((u_int64_t)(ccb->ccb_h.timeout) * (u_int32_t)hz / 1000));
+ ccb->ccb_h.sim_priv.entries[0].ptr = ch.callout;
+}
+
+static __inline struct callout_handle
+get_ccb_timeout_ch(union asr_ccb *ccb)
+{
+ struct callout_handle ch;
+
+ ch.callout = ccb->ccb_h.sim_priv.entries[0].ptr;
+ return ch;
+}
+
/*
* Here is the auto-probe structure used to nest our tests appropriately
* during the startup phase of the operating system.
@@ -812,8 +815,7 @@ ASR_ccbAdd(Asr_softc_t *sc, union asr_ccb *ccb)
*/
ccb->ccb_h.timeout = 6 * 60 * 1000;
}
- set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000));
+ set_ccb_timeout_ch(ccb);
}
splx(s);
} /* ASR_ccbAdd */
@@ -1337,9 +1339,7 @@ asr_timeout(void *arg)
cam_sim_unit(xpt_path_sim(ccb->ccb_h.path)), s);
if (ASR_reset (sc) == ENXIO) {
/* Try again later */
- set_ccb_timeout_ch(ccb, timeout(asr_timeout,
- (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000));
+ set_ccb_timeout_ch(ccb);
}
return;
}
@@ -1353,9 +1353,7 @@ asr_timeout(void *arg)
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_CMD_TIMEOUT) {
debug_asr_printf (" AGAIN\nreinitializing adapter\n");
if (ASR_reset (sc) == ENXIO) {
- set_ccb_timeout_ch(ccb, timeout(asr_timeout,
- (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000));
+ set_ccb_timeout_ch(ccb);
}
splx(s);
return;
@@ -1364,8 +1362,7 @@ asr_timeout(void *arg)
/* If the BUS reset does not take, then an adapter reset is next! */
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
ccb->ccb_h.status |= CAM_CMD_TIMEOUT;
- set_ccb_timeout_ch(ccb, timeout(asr_timeout, (caddr_t)ccb,
- (ccb->ccb_h.timeout * hz) / 1000));
+ set_ccb_timeout_ch(ccb);
ASR_resetBus (sc, cam_sim_bus(xpt_path_sim(ccb->ccb_h.path)));
xpt_async (AC_BUS_RESET, ccb->ccb_h.path, NULL);
splx(s);
diff --git a/sys/dev/buslogic/bt.c b/sys/dev/buslogic/bt.c
index b24442e..c385a18 100644
--- a/sys/dev/buslogic/bt.c
+++ b/sys/dev/buslogic/bt.c
@@ -1467,8 +1467,8 @@ btexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&bt->pending_ccbs, &ccb->ccb_h, sim_links.le);
- callout_reset(&bccb->timer, (ccb->ccb_h.timeout * hz) / 1000,
- bttimeout, bccb);
+ callout_reset_sbt(&bccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ bttimeout, bccb, 0);
/* Tell the adapter about this command */
bt->cur_outbox->ccb_addr = btccbvtop(bt, bccb);
@@ -1602,9 +1602,9 @@ btdone(struct bt_softc *bt, struct bt_ccb *bccb, bt_mbi_comp_code_t comp_code)
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
btdone(bt, pending_bccb, BMBI_ERROR);
} else {
- callout_reset(&pending_bccb->timer,
- (ccb_h->timeout * hz) / 1000,
- bttimeout, pending_bccb);
+ callout_reset_sbt(&pending_bccb->timer,
+ SBT_1MS * ccb_h->timeout, 0, bttimeout,
+ pending_bccb, 0);
ccb_h = LIST_NEXT(ccb_h, sim_links.le);
}
}
diff --git a/sys/dev/ciss/ciss.c b/sys/dev/ciss/ciss.c
index 5240051..918385a 100644
--- a/sys/dev/ciss/ciss.c
+++ b/sys/dev/ciss/ciss.c
@@ -2414,7 +2414,8 @@ ciss_wait_request(struct ciss_request *cr, int timeout)
return(error);
while ((cr->cr_flags & CISS_REQ_SLEEP) && (error != EWOULDBLOCK)) {
- error = msleep(cr, &cr->cr_sc->ciss_mtx, PRIBIO, "cissREQ", (timeout * hz) / 1000);
+ error = msleep_sbt(cr, &cr->cr_sc->ciss_mtx, PRIBIO, "cissREQ",
+ SBT_1MS * timeout, 0, 0);
}
return(error);
}
diff --git a/sys/dev/dpt/dpt_scsi.c b/sys/dev/dpt/dpt_scsi.c
index 3481cdc..666b1af 100644
--- a/sys/dev/dpt/dpt_scsi.c
+++ b/sys/dev/dpt/dpt_scsi.c
@@ -793,8 +793,8 @@ dptexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
dccb->state |= DCCB_ACTIVE;
ccb->ccb_h.status |= CAM_SIM_QUEUED;
LIST_INSERT_HEAD(&dpt->pending_ccb_list, &ccb->ccb_h, sim_links.le);
- callout_reset(&dccb->timer, (ccb->ccb_h.timeout * hz) / 1000,
- dpttimeout, dccb);
+ callout_reset_sbt(&dccb->timer, SBT_1MS * ccb->ccb_h.timeout, 0,
+ dpttimeout, dccb, 0);
if (dpt_send_eata_command(dpt, &dccb->eata_ccb,
dccb->eata_ccb.cp_busaddr,
EATA_CMD_DMA_SEND_CP, 0, 0, 0, 0) != 0) {
diff --git a/sys/dev/firewire/sbp.c b/sys/dev/firewire/sbp.c
index 5642ef4..bd81ec9 100644
--- a/sys/dev/firewire/sbp.c
+++ b/sys/dev/firewire/sbp.c
@@ -1058,8 +1058,8 @@ static __inline void
sbp_scan_dev(struct sbp_dev *sdev)
{
sdev->status = SBP_DEV_PROBE;
- callout_reset(&sdev->target->scan_callout, scan_delay * hz / 1000,
- sbp_cam_scan_target, (void *)sdev->target);
+ callout_reset_sbt(&sdev->target->scan_callout, SBT_1MS * scan_delay, 0,
+ sbp_cam_scan_target, (void *)sdev->target, 0);
}
static void
@@ -1427,7 +1427,7 @@ END_DEBUG
start:
target->mgm_ocb_cur = ocb;
- callout_reset(&target->mgm_ocb_timeout, 5*hz,
+ callout_reset(&target->mgm_ocb_timeout, 5 * hz,
sbp_mgm_timeout, (caddr_t)ocb);
xfer = sbp_write_cmd(sdev, FWTCODE_WREQB, 0);
if(xfer == NULL){
@@ -2779,9 +2779,11 @@ END_DEBUG
prev2 = prev = STAILQ_LAST(&sdev->ocbs, sbp_ocb, ocb);
STAILQ_INSERT_TAIL(&sdev->ocbs, ocb, ocb);
- if (ocb->ccb != NULL)
- callout_reset(&ocb->timer, (ocb->ccb->ccb_h.timeout * hz) / 1000,
- sbp_timeout, ocb);
+ if (ocb->ccb != NULL) {
+ callout_reset_sbt(&ocb->timer,
+ SBT_1MS * ocb->ccb->ccb_h.timeout, 0, sbp_timeout,
+ ocb, 0);
+ }
if (use_doorbell && prev == NULL)
prev2 = sdev->last_ocb;
diff --git a/sys/dev/glxiic/glxiic.c b/sys/dev/glxiic/glxiic.c
index 939c32d..b00e448 100644
--- a/sys/dev/glxiic/glxiic.c
+++ b/sys/dev/glxiic/glxiic.c
@@ -562,8 +562,8 @@ glxiic_start_timeout_locked(struct glxiic_softc *sc)
GLXIIC_ASSERT_LOCKED(sc);
- callout_reset(&sc->callout, sc->timeout * 1000 / hz, glxiic_timeout,
- sc);
+ callout_reset_sbt(&sc->callout, SBT_1MS * sc->timeout, 0,
+ glxiic_timeout, sc, 0);
}
static void
diff --git a/sys/dev/hpt27xx/hpt27xx_os_bsd.c b/sys/dev/hpt27xx/hpt27xx_os_bsd.c
index ed55828..37a69cb 100644
--- a/sys/dev/hpt27xx/hpt27xx_os_bsd.c
+++ b/sys/dev/hpt27xx/hpt27xx_os_bsd.c
@@ -289,8 +289,8 @@ void os_request_timer(void * osext, HPT_U32 interval)
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
- callout_reset(&vbus_ext->timer, interval * hz / 1000000,
- os_timer_for_ldm, vbus_ext);
+ callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0,
+ os_timer_for_ldm, vbus_ext, 0);
}
HPT_TIME os_query_time(void)
diff --git a/sys/dev/hptnr/hptnr_os_bsd.c b/sys/dev/hptnr/hptnr_os_bsd.c
index b11106c..b019a7c 100644
--- a/sys/dev/hptnr/hptnr_os_bsd.c
+++ b/sys/dev/hptnr/hptnr_os_bsd.c
@@ -235,8 +235,8 @@ void os_request_timer(void * osext, HPT_U32 interval)
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
- callout_reset(&vbus_ext->timer, interval * hz / 1000000,
- os_timer_for_ldm, vbus_ext);
+ callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0,
+ os_timer_for_ldm, vbus_ext, 0);
}
HPT_TIME os_query_time(void)
diff --git a/sys/dev/hptrr/hptrr_os_bsd.c b/sys/dev/hptrr/hptrr_os_bsd.c
index cc65d49..8600a8c 100644
--- a/sys/dev/hptrr/hptrr_os_bsd.c
+++ b/sys/dev/hptrr/hptrr_os_bsd.c
@@ -221,8 +221,8 @@ void os_request_timer(void * osext, HPT_U32 interval)
HPT_ASSERT(vbus_ext->ext_type==EXT_TYPE_VBUS);
- callout_reset(&vbus_ext->timer, interval * hz / 1000000,
- os_timer_for_ldm, vbus_ext);
+ callout_reset_sbt(&vbus_ext->timer, SBT_1US * interval, 0,
+ os_timer_for_ldm, vbus_ext, 0);
}
HPT_TIME os_query_time(void)
diff --git a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
index de5b43e..d00d279 100644
--- a/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
+++ b/sys/dev/hyperv/storvsc/hv_storvsc_drv_freebsd.c
@@ -983,9 +983,8 @@ storvsc_timeout(void *arg)
mtx_unlock(&sc->hs_lock);
reqp->retries++;
- callout_reset(&reqp->callout,
- (ccb->ccb_h.timeout * hz) / 1000,
- storvsc_timeout, reqp);
+ callout_reset_sbt(&reqp->callout, SBT_1MS * ccb->ccb_h.timeout,
+ 0, storvsc_timeout, reqp, 0);
#if HVS_TIMEOUT_TEST
storvsc_timeout_test(reqp, SEND_DIAGNOSTIC, 0);
#endif
@@ -1158,9 +1157,9 @@ storvsc_action(struct cam_sim *sim, union ccb *ccb)
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) {
callout_init(&reqp->callout, CALLOUT_MPSAFE);
- callout_reset(&reqp->callout,
- (ccb->ccb_h.timeout * hz) / 1000,
- storvsc_timeout, reqp);
+ callout_reset_sbt(&reqp->callout,
+ SBT_1MS * ccb->ccb_h.timeout, 0,
+ storvsc_timeout, reqp, 0);
#if HVS_TIMEOUT_TEST
cv_init(&reqp->event.cv, "storvsc timeout cv");
mtx_init(&reqp->event.mtx, "storvsc timeout mutex",
diff --git a/sys/dev/iir/iir.c b/sys/dev/iir/iir.c
index b2ebad8..27c5abb 100644
--- a/sys/dev/iir/iir.c
+++ b/sys/dev/iir/iir.c
@@ -267,7 +267,7 @@ iir_init(struct gdt_softc *gdt)
&gccb->gc_dmamap) != 0)
return(1);
gccb->gc_map_flag = TRUE;
- gccb->gc_scratch = &gdt->sc_gcscratch[GDT_SCRATCH_SZ * i];
+ gccb->gc_scratch = &gdt->sc_gcscratch[GDT_SCRATCH_SZ * i];
gccb->gc_scratch_busbase = gdt->sc_gcscratch_busbase + GDT_SCRATCH_SZ * i;
callout_init_mtx(&gccb->gc_timeout, &gdt->sc_lock, 0);
SLIST_INSERT_HEAD(&gdt->sc_free_gccb, gccb, sle);
@@ -1234,8 +1234,8 @@ gdtexecuteccb(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
ccb->ccb_h.status |= CAM_SIM_QUEUED;
/* timeout handling */
- callout_reset(&gccb->gc_timeout, (ccb->ccb_h.timeout * hz) / 1000,
- iir_timeout, gccb);
+ callout_reset_sbt(&gccb->gc_timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ iir_timeout, (caddr_t)gccb, 0);
gdt->sc_copy_cmd(gdt, gccb);
}
diff --git a/sys/dev/isci/isci_io_request.c b/sys/dev/isci/isci_io_request.c
index d1f5afe..4151900 100644
--- a/sys/dev/isci/isci_io_request.c
+++ b/sys/dev/isci/isci_io_request.c
@@ -731,8 +731,9 @@ isci_io_request_construct(void *arg, bus_dma_segment_t *seg, int nseg,
}
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY)
- callout_reset(&io_request->parent.timer, ccb->ccb_h.timeout,
- isci_io_request_timeout, io_request);
+ callout_reset_sbt(&io_request->parent.timer,
+ SBT_1MS * ccb->ccb_h.timeout, 0, isci_io_request_timeout,
+ io_request, 0);
}
void
@@ -983,7 +984,8 @@ isci_io_request_execute_smp_io(union ccb *ccb,
}
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY)
- callout_reset(&io_request->parent.timer, ccb->ccb_h.timeout,
- isci_io_request_timeout, request);
+ callout_reset_sbt(&io_request->parent.timer,
+ SBT_1MS * ccb->ccb_h.timeout, 0, isci_io_request_timeout,
+ request, 0);
}
#endif
diff --git a/sys/dev/isci/isci_timer.c b/sys/dev/isci/isci_timer.c
index 58ee223..1f22e94 100644
--- a/sys/dev/isci/isci_timer.c
+++ b/sys/dev/isci/isci_timer.c
@@ -79,8 +79,8 @@ scif_cb_timer_start(SCI_CONTROLLER_HANDLE_T controller, void *timer,
isci_timer->is_started = TRUE;
isci_log_message(3, "TIMER", "start %p %d\n", timer, milliseconds);
- callout_reset(&isci_timer->callout, (milliseconds * hz)/1000,
- isci_timer_timeout, timer);
+ callout_reset_sbt(&isci_timer->callout, SBT_1MS * milliseconds, 0,
+ isci_timer_timeout, timer, 0);
}
/**
diff --git a/sys/dev/mpr/mpr_sas.c b/sys/dev/mpr/mpr_sas.c
index 72b873b..216d314 100644
--- a/sys/dev/mpr/mpr_sas.c
+++ b/sys/dev/mpr/mpr_sas.c
@@ -1905,8 +1905,8 @@ mprsas_action_scsiio(struct mprsas_softc *sassc, union ccb *ccb)
cm->cm_desc.SCSIIO.DevHandle = htole16(targ->handle);
}
- callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000,
- mprsas_scsiio_timeout, cm);
+ callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ mprsas_scsiio_timeout, cm, 0);
targ->issued++;
targ->outstanding++;
diff --git a/sys/dev/mps/mps_sas.c b/sys/dev/mps/mps_sas.c
index 6ebf695..ef72457 100644
--- a/sys/dev/mps/mps_sas.c
+++ b/sys/dev/mps/mps_sas.c
@@ -1841,8 +1841,8 @@ mpssas_action_scsiio(struct mpssas_softc *sassc, union ccb *ccb)
}
}
- callout_reset(&cm->cm_callout, (ccb->ccb_h.timeout * hz) / 1000,
- mpssas_scsiio_timeout, cm);
+ callout_reset_sbt(&cm->cm_callout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ mpssas_scsiio_timeout, cm, 0);
targ->issued++;
targ->outstanding++;
diff --git a/sys/dev/mpt/mpt.c b/sys/dev/mpt/mpt.c
index ea8b556..2f7bfc2 100644
--- a/sys/dev/mpt/mpt.c
+++ b/sys/dev/mpt/mpt.c
@@ -1320,17 +1320,19 @@ mpt_wait_req(struct mpt_softc *mpt, request_t *req,
mpt_req_state_t state, mpt_req_state_t mask,
int sleep_ok, int time_ms)
{
- int error;
int timeout;
u_int saved_cnt;
+ sbintime_t sbt;
/*
- * timeout is in ms. 0 indicates infinite wait.
- * Convert to ticks or 500us units depending on
+ * time_ms is in ms, 0 indicates infinite wait.
+ * Convert to sbintime_t or 500us units depending on
* our sleep mode.
*/
if (sleep_ok != 0) {
- timeout = (time_ms * hz) / 1000;
+ sbt = SBT_1MS * time_ms;
+ /* Set timeout as well so final timeout check works. */
+ timeout = time_ms;
} else {
timeout = time_ms * 2;
}
@@ -1339,8 +1341,8 @@ mpt_wait_req(struct mpt_softc *mpt, request_t *req,
saved_cnt = mpt->reset_cnt;
while ((req->state & mask) != state && mpt->reset_cnt == saved_cnt) {
if (sleep_ok != 0) {
- error = mpt_sleep(mpt, req, PUSER, "mptreq", timeout);
- if (error == EWOULDBLOCK) {
+ if (mpt_sleep(mpt, req, PUSER, "mptreq", sbt) ==
+ EWOULDBLOCK) {
timeout = 0;
break;
}
diff --git a/sys/dev/mpt/mpt.h b/sys/dev/mpt/mpt.h
index 3835d21..1dcd76f 100644
--- a/sys/dev/mpt/mpt.h
+++ b/sys/dev/mpt/mpt.h
@@ -771,10 +771,10 @@ mpt_assign_serno(struct mpt_softc *mpt, request_t *req)
#define MPT_UNLOCK(mpt) mtx_unlock(&(mpt)->mpt_lock)
#define MPT_OWNED(mpt) mtx_owned(&(mpt)->mpt_lock)
#define MPT_LOCK_ASSERT(mpt) mtx_assert(&(mpt)->mpt_lock, MA_OWNED)
-#define mpt_sleep(mpt, ident, priority, wmesg, timo) \
- msleep(ident, &(mpt)->mpt_lock, priority, wmesg, timo)
-#define mpt_req_timeout(req, ticks, func, arg) \
- callout_reset(&(req)->callout, (ticks), (func), (arg))
+#define mpt_sleep(mpt, ident, priority, wmesg, sbt) \
+ msleep_sbt(ident, &(mpt)->mpt_lock, priority, wmesg, sbt, 0, 0)
+#define mpt_req_timeout(req, sbt, func, arg) \
+ callout_reset_sbt(&(req)->callout, (sbt), 0, (func), (arg), 0)
#define mpt_req_untimeout(req, func, arg) \
callout_stop(&(req)->callout)
#define mpt_callout_init(mpt, c) \
diff --git a/sys/dev/mpt/mpt_cam.c b/sys/dev/mpt/mpt_cam.c
index 20b0312..dafc2a7 100644
--- a/sys/dev/mpt/mpt_cam.c
+++ b/sys/dev/mpt/mpt_cam.c
@@ -1630,7 +1630,7 @@ out:
ccb->ccb_h.status |= CAM_SIM_QUEUED;
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) {
- mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000,
+ mpt_req_timeout(req, SBT_1MS * ccb->ccb_h.timeout,
mpt_timeout, ccb);
}
if (mpt->verbose > MPT_PRT_DEBUG) {
@@ -2016,7 +2016,7 @@ out:
ccb->ccb_h.status |= CAM_SIM_QUEUED;
if (ccb->ccb_h.timeout != CAM_TIME_INFINITY) {
- mpt_req_timeout(req, (ccb->ccb_h.timeout * hz) / 1000,
+ mpt_req_timeout(req, SBT_1MS * ccb->ccb_h.timeout,
mpt_timeout, ccb);
}
if (mpt->verbose > MPT_PRT_DEBUG) {
@@ -4752,7 +4752,7 @@ mpt_scsi_tgt_status(struct mpt_softc *mpt, union ccb *ccb, request_t *cmd_req,
req->serno, tgt->resid);
if (ccb) {
ccb->ccb_h.status = CAM_SIM_QUEUED | CAM_REQ_INPROG;
- mpt_req_timeout(req, 60 * hz, mpt_timeout, ccb);
+ mpt_req_timeout(req, SBT_1S * 60, mpt_timeout, ccb);
}
mpt_send_cmd(mpt, req);
}
diff --git a/sys/dev/mrsas/mrsas_cam.c b/sys/dev/mrsas/mrsas_cam.c
index b92bb5b..80ddc39 100644
--- a/sys/dev/mrsas/mrsas_cam.c
+++ b/sys/dev/mrsas/mrsas_cam.c
@@ -378,8 +378,8 @@ mrsas_scsiio_timeout(void *data)
* on OCR enable/disable property of Controller from ocr_thread
* context.
*/
- callout_reset(&cmd->cm_callout, (600000 * hz) / 1000,
- mrsas_scsiio_timeout, cmd);
+ callout_reset_sbt(&cmd->cm_callout, SBT_1S * 600, 0,
+ mrsas_scsiio_timeout, cmd, 0);
sc->do_timedout_reset = 1;
if (sc->ocr_thread_active)
wakeup(&sc->ocr_chan);
@@ -530,8 +530,8 @@ mrsas_startio(struct mrsas_softc *sc, struct cam_sim *sim,
/*
* Start timer for IO timeout. Default timeout value is 90 second.
*/
- callout_reset(&cmd->cm_callout, (sc->mrsas_io_timeout * hz) / 1000,
- mrsas_scsiio_timeout, cmd);
+ callout_reset_sbt(&cmd->cm_callout, SBT_1MS * sc->mrsas_io_timeout, 0,
+ mrsas_scsiio_timeout, cmd, 0);
mrsas_atomic_inc(&sc->fw_outstanding);
if (mrsas_atomic_read(&sc->fw_outstanding) > sc->io_cmds_highwater)
diff --git a/sys/dev/mvs/mvs.c b/sys/dev/mvs/mvs.c
index 8ad85a8..f5069ff 100644
--- a/sys/dev/mvs/mvs.c
+++ b/sys/dev/mvs/mvs.c
@@ -1416,8 +1416,8 @@ mvs_legacy_execute_transaction(struct mvs_slot *slot)
}
}
/* Start command execution timeout */
- callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000,
- (timeout_t*)mvs_timeout, slot);
+ callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ (timeout_t*)mvs_timeout, slot, 0);
}
/* Must be called with channel locked. */
@@ -1530,8 +1530,8 @@ mvs_execute_transaction(struct mvs_slot *slot)
ATA_OUTL(ch->r_mem, EDMA_REQQIP,
ch->dma.workrq_bus + MVS_CRQB_OFFSET + (MVS_CRQB_SIZE * ch->out_idx));
/* Start command execution timeout */
- callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000,
- (timeout_t*)mvs_timeout, slot);
+ callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ (timeout_t*)mvs_timeout, slot, 0);
return;
}
@@ -1568,9 +1568,9 @@ mvs_rearm_timeout(device_t dev)
continue;
if ((ch->toslots & (1 << i)) == 0)
continue;
- callout_reset(&slot->timeout,
- (int)slot->ccb->ccb_h.timeout * hz / 2000,
- (timeout_t*)mvs_timeout, slot);
+ callout_reset_sbt(&slot->timeout,
+ SBT_1MS * slot->ccb->ccb_h.timeout / 2, 0,
+ (timeout_t*)mvs_timeout, slot, 0);
}
}
diff --git a/sys/dev/siis/siis.c b/sys/dev/siis/siis.c
index dd2bd70..d8a4098 100644
--- a/sys/dev/siis/siis.c
+++ b/sys/dev/siis/siis.c
@@ -1119,8 +1119,8 @@ siis_execute_transaction(struct siis_slot *slot)
ATA_OUTL(ch->r_mem, SIIS_P_CACTL(slot->slot), prb_bus);
ATA_OUTL(ch->r_mem, SIIS_P_CACTH(slot->slot), prb_bus >> 32);
/* Start command execution timeout */
- callout_reset(&slot->timeout, (int)ccb->ccb_h.timeout * hz / 1000,
- (timeout_t*)siis_timeout, slot);
+ callout_reset_sbt(&slot->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ (timeout_t*)siis_timeout, slot, 0);
return;
}
@@ -1161,9 +1161,9 @@ siis_rearm_timeout(device_t dev)
continue;
if ((ch->toslots & (1 << i)) == 0)
continue;
- callout_reset(&slot->timeout,
- (int)slot->ccb->ccb_h.timeout * hz / 1000,
- (timeout_t*)siis_timeout, slot);
+ callout_reset_sbt(&slot->timeout,
+ SBT_1MS * slot->ccb->ccb_h.timeout, 0,
+ (timeout_t*)siis_timeout, slot, 0);
}
}
diff --git a/sys/dev/sym/sym_hipd.c b/sys/dev/sym/sym_hipd.c
index 75e770f..5576e72 100644
--- a/sys/dev/sym/sym_hipd.c
+++ b/sys/dev/sym/sym_hipd.c
@@ -2335,8 +2335,8 @@ static void sym_enqueue_cam_ccb(ccb_p cp)
assert(!(ccb->ccb_h.status & CAM_SIM_QUEUED));
ccb->ccb_h.status = CAM_REQ_INPROG;
- callout_reset(&cp->ch, ccb->ccb_h.timeout * hz / 1000, sym_callout,
- (caddr_t) ccb);
+ callout_reset_sbt(&cp->ch, SBT_1MS * ccb->ccb_h.timeout, 0, sym_callout,
+ (caddr_t)ccb, 0);
ccb->ccb_h.status |= CAM_SIM_QUEUED;
ccb->ccb_h.sym_hcb_ptr = np;
diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c
index 6032798..41f049e 100644
--- a/sys/dev/trm/trm.c
+++ b/sys/dev/trm/trm.c
@@ -473,10 +473,6 @@ trm_ExecuteSRB(void *arg, bus_dma_segment_t *dm_segs, int nseg, int error)
return;
}
ccb->ccb_h.status |= CAM_SIM_QUEUED;
-#if 0
- /* XXX Need a timeout handler */
- ccb->ccb_h.timeout_ch = timeout(trmtimeout, (caddr_t)srb, (ccb->ccb_h.timeout * hz) / 1000);
-#endif
trm_SendSRB(pACB, pSRB);
splx(flags);
return;
diff --git a/sys/dev/tws/tws_cam.c b/sys/dev/tws/tws_cam.c
index 9b429d2..0002715 100644
--- a/sys/dev/tws/tws_cam.c
+++ b/sys/dev/tws/tws_cam.c
@@ -747,7 +747,8 @@ tws_execute_scsi(struct tws_softc *sc, union ccb *ccb)
* and submit the I/O.
*/
sc->stats.scsi_ios++;
- callout_reset(&req->timeout, (ccb_h->timeout * hz) / 1000, tws_timeout, req);
+ callout_reset_sbt(&req->timeout, SBT_1MS * ccb->ccb_h.timeout, 0,
+ tws_timeout, req, 0);
error = tws_map_request(sc, req);
return(error);
}
diff --git a/sys/dev/virtio/scsi/virtio_scsi.c b/sys/dev/virtio/scsi/virtio_scsi.c
index aa9168b..7c071b0 100644
--- a/sys/dev/virtio/scsi/virtio_scsi.c
+++ b/sys/dev/virtio/scsi/virtio_scsi.c
@@ -1087,8 +1087,8 @@ vtscsi_execute_scsi_cmd(struct vtscsi_softc *sc, struct vtscsi_request *req)
if (ccbh->timeout != CAM_TIME_INFINITY) {
req->vsr_flags |= VTSCSI_REQ_FLAG_TIMEOUT_SET;
- callout_reset(&req->vsr_callout, ccbh->timeout * hz / 1000,
- vtscsi_timedout_scsi_cmd, req);
+ callout_reset_sbt(&req->vsr_callout, SBT_1MS * ccbh->timeout,
+ 0, vtscsi_timedout_scsi_cmd, req, 0);
}
vtscsi_dprintf_req(req, VTSCSI_TRACE, "enqueued req=%p ccb=%p\n",
OpenPOWER on IntegriCloud