summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2003-09-16 16:07:15 +0000
committerscottl <scottl@FreeBSD.org>2003-09-16 16:07:15 +0000
commit6f2488dbbc95a5706ab0a65014f031d6edebf6d2 (patch)
treee47a042f595826fcb5a908a5a8e359157919f928 /sys/dev/aac
parentc13a8cc2c7c14d4d5b75dae625ae2d0c9eaa3933 (diff)
downloadFreeBSD-src-6f2488dbbc95a5706ab0a65014f031d6edebf6d2.zip
FreeBSD-src-6f2488dbbc95a5706ab0a65014f031d6edebf6d2.tar.gz
Correctly wrap the producer queue index when dequeuing commands. This wasn't
a problem for command responses since we rarely ever filled the queue. However, adapter-initiated commands have a much smaller queue and could tickle this bug. It's possible that this might fix the recently reported problems with the aac-2120s, though I haven't been able to reproduce the problem locally. MFC-After: 1 day
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 140ed9d..9389511 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -1877,7 +1877,11 @@ aac_dequeue_fib(struct aac_softc *sc, int queue, u_int32_t *fib_size,
error = ENOENT;
goto out;
}
-
+
+ /* wrap the pi so the following test works */
+ if (pi >= aac_qinfo[queue].size)
+ pi = 0;
+
notify = 0;
if (ci == pi + 1)
notify++;
OpenPOWER on IntegriCloud