summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2005-09-14 05:46:28 +0000
committerscottl <scottl@FreeBSD.org>2005-09-14 05:46:28 +0000
commitf33b11ee7815c704d5f661a015cf2639a1f17a52 (patch)
tree1f1f640e500b284eb3e99e8e888c11f5a2cc9a94 /sys/dev/aac
parent21f50f82057c8c895c388437670ae67765796ea8 (diff)
downloadFreeBSD-src-f33b11ee7815c704d5f661a015cf2639a1f17a52.zip
FreeBSD-src-f33b11ee7815c704d5f661a015cf2639a1f17a52.tar.gz
Use time_uptime for timing commands instead of time_second. This is a bit
risky because the "current time" is supposed to be fed to the card during initialization, and the current time is supposed to be put into each command that is sent to the card. Hopefully either the card doesn't actually care about the timestamps, or it doesn't care about the absolute values so long and the relative values are consistent. Not an MFC candidate until more thorough testing can be done.
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index d8e1d1a..e8d3607 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -925,7 +925,7 @@ aac_bio_command(struct aac_softc *sc, struct aac_command **cmp)
cm->cm_datalen = bp->bio_bcount;
cm->cm_complete = aac_bio_complete;
cm->cm_private = bp;
- cm->cm_timestamp = time_second;
+ cm->cm_timestamp = time_uptime;
cm->cm_queue = AAC_ADAP_NORM_CMD_QUEUE;
/* build the FIB */
@@ -1426,7 +1426,7 @@ aac_init(struct aac_softc *sc)
/*
* First wait for the adapter to come ready.
*/
- then = time_second;
+ then = time_uptime;
do {
code = AAC_GET_FWSTATUS(sc);
if (code & AAC_SELF_TEST_FAILED) {
@@ -1438,7 +1438,7 @@ aac_init(struct aac_softc *sc)
"FATAL: controller kernel panic\n");
return(ENXIO);
}
- if (time_second > (then + AAC_BOOT_TIMEOUT)) {
+ if (time_uptime > (then + AAC_BOOT_TIMEOUT)) {
device_printf(sc->aac_dev,
"FATAL: controller not coming ready, "
"status %x\n", code);
@@ -1573,7 +1573,7 @@ aac_init(struct aac_softc *sc)
ip->HostPhysMemPages =
(ip->HostPhysMemPages + AAC_PAGE_SIZE) / AAC_PAGE_SIZE;
}
- ip->HostElapsedSeconds = time_second; /* reset later if invalid */
+ ip->HostElapsedSeconds = time_uptime; /* reset later if invalid */
/*
* Initialise FIB queues. Note that it appears that the layout of the
@@ -1701,9 +1701,9 @@ aac_sync_command(struct aac_softc *sc, u_int32_t command,
AAC_QNOTIFY(sc, AAC_DB_SYNC_COMMAND);
/* spin waiting for the command to complete */
- then = time_second;
+ then = time_uptime;
do {
- if (time_second > (then + AAC_IMMEDIATE_TIMEOUT)) {
+ if (time_uptime > (then + AAC_IMMEDIATE_TIMEOUT)) {
debug(1, "timed out");
return(EIO);
}
@@ -1997,14 +1997,14 @@ aac_timeout(struct aac_softc *sc)
* only.
*/
timedout = 0;
- deadline = time_second - AAC_CMD_TIMEOUT;
+ deadline = time_uptime - AAC_CMD_TIMEOUT;
TAILQ_FOREACH(cm, &sc->aac_busy, cm_link) {
if ((cm->cm_timestamp < deadline)
/* && !(cm->cm_flags & AAC_CMD_TIMEDOUT) */) {
cm->cm_flags |= AAC_CMD_TIMEDOUT;
device_printf(sc->aac_dev,
"COMMAND %p TIMEOUT AFTER %d SECONDS\n",
- cm, (int)(time_second-cm->cm_timestamp));
+ cm, (int)(time_uptime-cm->cm_timestamp));
AAC_PRINT_FIB(sc, cm->cm_fib);
timedout++;
}
@@ -2602,7 +2602,7 @@ aac_ioctl_sendfib(struct aac_softc *sc, caddr_t ufib)
if ((error = copyin(ufib, cm->cm_fib, size)) != 0)
goto out;
cm->cm_fib->Header.Size = size;
- cm->cm_timestamp = time_second;
+ cm->cm_timestamp = time_uptime;
/*
* Pass the FIB to the controller, wait for it to complete.
OpenPOWER on IntegriCloud