aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/DMA-attributes.txt18
-rw-r--r--include/linux/dma-attrs.h1
2 files changed, 19 insertions, 0 deletions
diff --git a/Documentation/DMA-attributes.txt b/Documentation/DMA-attributes.txt
index 5c72eed89563..725580de75af 100644
--- a/Documentation/DMA-attributes.txt
+++ b/Documentation/DMA-attributes.txt
@@ -49,3 +49,21 @@ DMA_ATTR_NON_CONSISTENT lets the platform to choose to return either
49consistent or non-consistent memory as it sees fit. By using this API, 49consistent or non-consistent memory as it sees fit. By using this API,
50you are guaranteeing to the platform that you have all the correct and 50you are guaranteeing to the platform that you have all the correct and
51necessary sync points for this memory in the driver. 51necessary sync points for this memory in the driver.
52
53DMA_ATTR_NO_KERNEL_MAPPING
54--------------------------
55
56DMA_ATTR_NO_KERNEL_MAPPING lets the platform to avoid creating a kernel
57virtual mapping for the allocated buffer. On some architectures creating
58such mapping is non-trivial task and consumes very limited resources
59(like kernel virtual address space or dma consistent address space).
60Buffers allocated with this attribute can be only passed to user space
61by calling dma_mmap_attrs(). By using this API, you are guaranteeing
62that you won't dereference the pointer returned by dma_alloc_attr(). You
63can threat it as a cookie that must be passed to dma_mmap_attrs() and
64dma_free_attrs(). Make sure that both of these also get this attribute
65set on each call.
66
67Since it is optional for platforms to implement
68DMA_ATTR_NO_KERNEL_MAPPING, those that do not will simply ignore the
69attribute and exhibit default behavior.
diff --git a/include/linux/dma-attrs.h b/include/linux/dma-attrs.h
index 547ab568d3ae..a37c10cc51c5 100644
--- a/include/linux/dma-attrs.h
+++ b/include/linux/dma-attrs.h
@@ -15,6 +15,7 @@ enum dma_attr {
15 DMA_ATTR_WEAK_ORDERING, 15 DMA_ATTR_WEAK_ORDERING,
16 DMA_ATTR_WRITE_COMBINE, 16 DMA_ATTR_WRITE_COMBINE,
17 DMA_ATTR_NON_CONSISTENT, 17 DMA_ATTR_NON_CONSISTENT,
18 DMA_ATTR_NO_KERNEL_MAPPING,
18 DMA_ATTR_MAX, 19 DMA_ATTR_MAX,
19}; 20};
20 21