mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 08:08:54 +00:00
dma-mapping: move the dma_get_sgtable API comments from arm to common code
The comments are spot on and should be near the central API, not just near a single implementation. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
392e879a44
commit
1445146701
2 changed files with 11 additions and 11 deletions
|
@ -877,17 +877,6 @@ static void arm_coherent_dma_free(struct device *dev, size_t size, void *cpu_add
|
||||||
__arm_dma_free(dev, size, cpu_addr, handle, attrs, true);
|
__arm_dma_free(dev, size, cpu_addr, handle, attrs, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
|
|
||||||
* that the intention is to allow exporting memory allocated via the
|
|
||||||
* coherent DMA APIs through the dma_buf API, which only accepts a
|
|
||||||
* scattertable. This presents a couple of problems:
|
|
||||||
* 1. Not all memory allocated via the coherent DMA APIs is backed by
|
|
||||||
* a struct page
|
|
||||||
* 2. Passing coherent DMA memory into the streaming APIs is not allowed
|
|
||||||
* as we will try to flush the memory through a different alias to that
|
|
||||||
* actually being used (and the flushes are redundant.)
|
|
||||||
*/
|
|
||||||
int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
int arm_dma_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||||
void *cpu_addr, dma_addr_t handle, size_t size,
|
void *cpu_addr, dma_addr_t handle, size_t size,
|
||||||
unsigned long attrs)
|
unsigned long attrs)
|
||||||
|
|
|
@ -136,6 +136,17 @@ int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The whole dma_get_sgtable() idea is fundamentally unsafe - it seems
|
||||||
|
* that the intention is to allow exporting memory allocated via the
|
||||||
|
* coherent DMA APIs through the dma_buf API, which only accepts a
|
||||||
|
* scattertable. This presents a couple of problems:
|
||||||
|
* 1. Not all memory allocated via the coherent DMA APIs is backed by
|
||||||
|
* a struct page
|
||||||
|
* 2. Passing coherent DMA memory into the streaming APIs is not allowed
|
||||||
|
* as we will try to flush the memory through a different alias to that
|
||||||
|
* actually being used (and the flushes are redundant.)
|
||||||
|
*/
|
||||||
int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt,
|
int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt,
|
||||||
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
void *cpu_addr, dma_addr_t dma_addr, size_t size,
|
||||||
unsigned long attrs)
|
unsigned long attrs)
|
||||||
|
|
Loading…
Reference in a new issue