summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2008-06-24 03:26:41 +0000
committeremaste <emaste@FreeBSD.org>2008-06-24 03:26:41 +0000
commit57a33adf31b4fbc5c9c7577e8f1f93bdf26ba03c (patch)
treeb9e6fb8d8fbc28e65b55b72b769a9caab6600b55
parent29b8978e1ff8f6fa6abc582e1782f5bda7b51e9c (diff)
downloadFreeBSD-src-57a33adf31b4fbc5c9c7577e8f1f93bdf26ba03c.zip
FreeBSD-src-57a33adf31b4fbc5c9c7577e8f1f93bdf26ba03c.tar.gz
Fix test for waiting AIFs in aac_poll(). This seems to solve the
problem where Adaptec's arcconf monitoring tool hangs after producing its expected output. Submitted by: Adaptec, via driver ver 15317 MFC after: 1 week
-rw-r--r--sys/dev/aac/aac.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index a26397a..d6754ad 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -2998,6 +2998,7 @@ static int
aac_poll(struct cdev *dev, int poll_events, d_thread_t *td)
{
struct aac_softc *sc;
+ struct aac_fib_context *ctx;
int revents;
sc = dev->si_drv1;
@@ -3005,8 +3006,12 @@ aac_poll(struct cdev *dev, int poll_events, d_thread_t *td)
mtx_lock(&sc->aac_aifq_lock);
if ((poll_events & (POLLRDNORM | POLLIN)) != 0) {
- if (sc->aifq_idx != 0 || sc->aifq_filled)
- revents |= poll_events & (POLLIN | POLLRDNORM);
+ for (ctx = sc->fibctx; ctx; ctx = ctx->next) {
+ if (ctx->ctx_idx != sc->aifq_idx || ctx->ctx_wrap) {
+ revents |= poll_events & (POLLIN | POLLRDNORM);
+ break;
+ }
+ }
}
mtx_unlock(&sc->aac_aifq_lock);
OpenPOWER on IntegriCloud