summaryrefslogtreecommitdiffstats
path: root/kernel/dma/mapping.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/dma/mapping.c')
-rw-r--r--kernel/dma/mapping.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/kernel/dma/mapping.c b/kernel/dma/mapping.c
index 72c825c1788e..a136932b8e6d 100644
--- a/kernel/dma/mapping.c
+++ b/kernel/dma/mapping.c
@@ -136,6 +136,17 @@ int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
136 return ret; 136 return ret;
137} 137}
138 138
139/*
140 * The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
141 * that the intention is to allow exporting memory allocated via the
142 * coherent DMA APIs through the dma_buf API, which only accepts a
143 * scattertable. This presents a couple of problems:
144 * 1. Not all memory allocated via the coherent DMA APIs is backed by
145 * a struct page
146 * 2. Passing coherent DMA memory into the streaming APIs is not allowed
147 * as we will try to flush the memory through a different alias to that
148 * actually being used (and the flushes are redundant.)
149 */
139int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, 150int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt,
140 void *cpu_addr, dma_addr_t dma_addr, size_t size, 151 void *cpu_addr, dma_addr_t dma_addr, size_t size,
141 unsigned long attrs) 152 unsigned long attrs)