summaryrefslogtreecommitdiff
path: root/Documentation
diff options
context:
space:
mode:
authorLeon Romanovsky <leonro@nvidia.com>2026-03-16 21:06:48 +0200
committerMarek Szyprowski <m.szyprowski@samsung.com>2026-03-20 12:05:36 +0100
commite6a58fa2556203a7f6731b4071705dc81cca5ca5 (patch)
tree404642b67acba4db7d6162c52cc55d4ac8f8f2ab /Documentation
parent9bb0a4d6a4433b75274204b083dac8e515d2007d (diff)
dma-mapping: Introduce DMA require coherency attribute
The mapping buffers which carry this attribute require DMA coherent system. This means that they can't take SWIOTLB path, can perform CPU cache overlap and doesn't perform cache flushing. Signed-off-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Link: https://lore.kernel.org/r/20260316-dma-debug-overlap-v3-4-1dde90a7f08b@nvidia.com
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/core-api/dma-attributes.rst16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/core-api/dma-attributes.rst b/Documentation/core-api/dma-attributes.rst
index 48cfe86cc06d..123c8468d58f 100644
--- a/Documentation/core-api/dma-attributes.rst
+++ b/Documentation/core-api/dma-attributes.rst
@@ -163,3 +163,19 @@ data corruption.
All mappings that share a cache line must set this attribute to suppress DMA
debug warnings about overlapping mappings.
+
+DMA_ATTR_REQUIRE_COHERENT
+-------------------------
+
+DMA mapping requests with the DMA_ATTR_REQUIRE_COHERENT fail on any
+system where SWIOTLB or cache management is required. This should only
+be used to support uAPI designs that require continuous HW DMA
+coherence with userspace processes, for example RDMA and DRM. At a
+minimum the memory being mapped must be userspace memory from
+pin_user_pages() or similar.
+
+Drivers should consider using dma_mmap_pages() instead of this
+interface when building their uAPIs, when possible.
+
+It must never be used in an in-kernel driver that only works with
+kernel memory.