freebsd-skq/sys/dev/nvme
Warner Losh 082905cad1 nvme: Remove a wmb() that's not necessary.
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
2020-12-04 21:34:48 +00:00
..
nvme_ahci.c Make nvme(4) driver some more NUMA aware. 2019-09-23 17:53:47 +00:00
nvme_ctrlr_cmd.c Add Host Memory Buffer support to nvme(4). 2020-01-07 21:17:11 +00:00
nvme_ctrlr.c Remove aligment requirements for passthrough buffer. 2020-11-29 00:57:19 +00:00
nvme_ns_cmd.c Add a brief comment explaining why we can return ETIMEDOUT from the call to the 2019-09-02 17:10:46 +00:00
nvme_ns.c Fix various Coverity-detected errors in nvme driver 2020-05-02 20:47:58 +00:00
nvme_pci.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00
nvme_private.h Increase nvme(4) maximum transfer size from 1MB to 2MB. 2020-11-29 00:20:31 +00:00
nvme_qpair.c nvme: Remove a wmb() that's not necessary. 2020-12-04 21:34:48 +00:00
nvme_sim.c Report cpi->hba_* for nda(4) because why not. 2020-08-12 20:05:43 +00:00
nvme_sysctl.c nvme: Remove compat code for older kernels 2020-10-24 01:59:01 +00:00
nvme_test.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00
nvme_util.c nvme: clean up empty lines in .c and .h files 2020-09-01 22:03:10 +00:00
nvme.c Fix panic if NVMe is detached before the intrhook call. 2020-11-12 20:20:43 +00:00
nvme.h nvme: Fix typo in definition 2020-12-02 15:59:08 +00:00