From 4e2bef2beb918241225e7dee824a4714ebb51028 Mon Sep 17 00:00:00 2001 From: Ian Moffett Date: Fri, 12 Jul 2024 19:17:26 -0400 Subject: kernel: nvme: Handle cq_head and phase bit Signed-off-by: Ian Moffett --- sys/dev/ic/nvme.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index 9eb302b..444cc3e 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -240,6 +240,13 @@ nvme_poll_submit_cmd(struct nvme_queue *q, struct nvme_cmd cmd) ++spins; } + ++q->cq_head; + if (q->cq_head >= q->size) { + q->cq_head = 0; + q->cq_phase = !q->cq_phase; + } + + mmio_write32(q->cq_db, q->cq_head); return 0; } -- cgit v1.2.3