summaryrefslogtreecommitdiffstats
path: root/sys/dev/ahci
diff options
context:
space:
mode:
authorsmh <smh@FreeBSD.org>2014-12-21 03:06:11 +0000
committersmh <smh@FreeBSD.org>2014-12-21 03:06:11 +0000
commitf73f068967977545d4d60b36864475974dca2613 (patch)
tree25e0e0aad4faf12d9100173a8b5cb4866ec97cdf /sys/dev/ahci
parent4ae371d305e8c60f2e534058d1727f819749b623 (diff)
downloadFreeBSD-src-f73f068967977545d4d60b36864475974dca2613.zip
FreeBSD-src-f73f068967977545d4d60b36864475974dca2613.tar.gz
MFC r274819:
Prevent overflow issues in timeout processing MFC r274852: Fix build with asr driver Sponsored by: Multiplay
Diffstat (limited to 'sys/dev/ahci')
-rw-r--r--sys/dev/ahci/ahci.c16
1 files changed, 8 insertions, 8 deletions
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;
}
OpenPOWER on IntegriCloud