summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2014-11-04 12:48:23 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2014-11-04 12:48:23 +0000
commit04784f9c845ddf5701d5675842e04667050bf001 (patch)
tree66698d559aea22d5cc4ac217862ed0679b57e5cb /sys/dev/ic
parent9bd207ea14b580701e579bad1356ba341eaef262 (diff)
shuffle when the cid is set on submission queue entries so its after
when the caller fills the entry.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/nvme.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 995703513b2..754153534ba 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvme.c,v 1.9 2014/11/04 12:41:34 dlg Exp $ */
+/* $OpenBSD: nvme.c,v 1.10 2014/11/04 12:48:22 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -333,8 +333,8 @@ nvme_q_submit(struct nvme_softc *sc, struct nvme_queue *q, struct nvme_ccb *ccb,
bus_dmamap_sync(sc->sc_dmat, NVME_DMA_MAP(q->q_sq_dmamem),
sizeof(*sqe) * tail, sizeof(*sqe), BUS_DMASYNC_POSTWRITE);
memset(sqe, 0, sizeof(*sqe));
- sqe->cid = ccb->ccb_id;
(*fill)(sc, ccb, sqe);
+ sqe->cid = ccb->ccb_id;
bus_dmamap_sync(sc->sc_dmat, NVME_DMA_MAP(q->q_sq_dmamem),
sizeof(*sqe) * tail, sizeof(*sqe), BUS_DMASYNC_PREWRITE);
@@ -357,7 +357,6 @@ nvme_poll(struct nvme_softc *sc, struct nvme_queue *q, struct nvme_ccb *ccb,
u_int16_t flags;
memset(&state, 0, sizeof(state));
- state.s.cid = ccb->ccb_id;
(*fill)(sc, ccb, &state.s);
done = ccb->ccb_done;