aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-07-12 19:17:26 -0400
committerIan Moffett <ian@osmora.org>2024-07-12 19:17:26 -0400
commit4e2bef2beb918241225e7dee824a4714ebb51028 (patch)
treee10128da9fc3cf8532c199182fa3ad2e6cb45cf8 /sys
parentd117265f1e2b465c29c919a7ad594232d645cf76 (diff)
kernel: nvme: Handle cq_head and phase bit
Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/nvme.c7
1 files changed, 7 insertions, 0 deletions
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;
}