aboutsummaryrefslogtreecommitdiff
path: root/README
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2020-12-04 21:34:48 +0000
committerWarner Losh <imp@FreeBSD.org>2020-12-04 21:34:48 +0000
commit082905cad121bf6721606b6b9ba20a09bc6e56d0 (patch)
treea7f070c875a04271677466024956aacc1fadc5e6 /README
parent730b1b4d1c7448a0bad3ad75f9ab5df2c64ffcf6 (diff)
downloadsrc-082905cad121bf6721606b6b9ba20a09bc6e56d0.tar.gz
src-082905cad121bf6721606b6b9ba20a09bc6e56d0.zip
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
Notes
Notes: svn path=/head/; revision=368352
Diffstat (limited to 'README')
0 files changed, 0 insertions, 0 deletions