diff options
-rw-r--r-- | Documentation/DMA-attributes.txt | 18 | ||||
-rw-r--r-- | include/linux/dma-attrs.h | 1 |
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 | |||
49 | consistent or non-consistent memory as it sees fit. By using this API, | 49 | consistent or non-consistent memory as it sees fit. By using this API, |
50 | you are guaranteeing to the platform that you have all the correct and | 50 | you are guaranteeing to the platform that you have all the correct and |
51 | necessary sync points for this memory in the driver. | 51 | necessary sync points for this memory in the driver. |
52 | |||
53 | DMA_ATTR_NO_KERNEL_MAPPING | ||
54 | -------------------------- | ||
55 | |||
56 | DMA_ATTR_NO_KERNEL_MAPPING lets the platform to avoid creating a kernel | ||
57 | virtual mapping for the allocated buffer. On some architectures creating | ||
58 | such mapping is non-trivial task and consumes very limited resources | ||
59 | (like kernel virtual address space or dma consistent address space). | ||
60 | Buffers allocated with this attribute can be only passed to user space | ||
61 | by calling dma_mmap_attrs(). By using this API, you are guaranteeing | ||
62 | that you won't dereference the pointer returned by dma_alloc_attr(). You | ||
63 | can threat it as a cookie that must be passed to dma_mmap_attrs() and | ||
64 | dma_free_attrs(). Make sure that both of these also get this attribute | ||
65 | set on each call. | ||
66 | |||
67 | Since it is optional for platforms to implement | ||
68 | DMA_ATTR_NO_KERNEL_MAPPING, those that do not will simply ignore the | ||
69 | attribute 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 | ||