Commit 6da02181 authored by Keith Busch's avatar Keith Busch Committed by Kevin Wolf
Browse files

nvme: Fix spurious interrupts



The code had asserted an interrupt every time it was requested to check
for new completion queue entries.This can result in spurious interrupts
seen by the guest OS.

Fix this by asserting an interrupt only if there are un-acknowledged
completion queue entries available.

Reported-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarKeith Busch <keith.busch@intel.com>
Tested-by: default avatarGuenter Roeck <linux@roeck-us.net>
Signed-off-by: default avatarKevin Wolf <kwolf@redhat.com>
parent 330ca111
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -272,8 +272,10 @@ static void nvme_post_cqes(void *opaque)
            sizeof(req->cqe));
        QTAILQ_INSERT_TAIL(&sq->req_list, req, entry);
    }
    if (cq->tail != cq->head) {
        nvme_irq_assert(n, cq);
    }
}

static void nvme_enqueue_req_completion(NvmeCQueue *cq, NvmeRequest *req)
{