virtio_p9fs: Check for completions after enabling interrupts

Otherwise we can end up with a lost interrupt, causing lost request
completion wakeups and hangs in the filesystem layer.

Continue processing until we enable interrupts and then observe an empty
queue, like other virtio drivers do.

Sponsored by:	Klara, Inc.
This commit is contained in:
Mark Johnston 2024-10-25 17:52:22 +00:00 committed by Franco Fichtner
parent d6cd1fd7cf
commit 347a2f813e

View File

@ -222,11 +222,15 @@ vt9p_intr_complete(void *xsc)
P9_DEBUG(TRANS, "%s: completing\n", __func__);
VT9P_LOCK(chan);
again:
while ((curreq = virtqueue_dequeue(vq, NULL)) != NULL) {
curreq->rc->tag = curreq->tc->tag;
wakeup_one(curreq);
}
virtqueue_enable_intr(vq);
if (virtqueue_enable_intr(vq) != 0) {
virtqueue_disable_intr(vq);
goto again;
}
cv_signal(&chan->submit_cv);
VT9P_UNLOCK(chan);
}