02feab2c54
bus_dmamap_sync() ensures that memory that's prepared for PREWRITE can be DMA'd immediately after it returns. The details differ, but this mirrors atomic thread release semantics, at least for the buffers synced. For non-x86 platforms, bus_dmamap_sync() has the right syncing and fences. So in the past, wmb() had been omitted for them. For x86 platforms, the memory ordering is already strong enough to ensure DMA to the device sees the current contents. As such, we don't need the wmb() here. It translates to an sfence which is only needed for writes to regions that have the write combining attribute set or when some exotic opcodes are used. The nvme driver does neither of these. Since bus_dmamap_sync() includes atomic_thread_fence_rel, we can be assured any optimizer won't reorder the bus_dmamap_sync and the bus_space_write operations. The wmb() was a vestiage of the pre-busdma version initially committed to the tree. Reviewed by: kib@, gallatin@, chuck@, mav@ Differential Revision: https://reviews.freebsd.org/D27448 |
||
---|---|---|
.. | ||
nvme_ahci.c | ||
nvme_ctrlr_cmd.c | ||
nvme_ctrlr.c | ||
nvme_ns_cmd.c | ||
nvme_ns.c | ||
nvme_pci.c | ||
nvme_private.h | ||
nvme_qpair.c | ||
nvme_sim.c | ||
nvme_sysctl.c | ||
nvme_test.c | ||
nvme_util.c | ||
nvme.c | ||
nvme.h |