Thread (74 messages) 74 messages, 7 authors, 2022-02-25

Re: [PATCH 2/2] kernel/dma: rename dma_alloc_direct and dma_map_direct

From: Christoph Hellwig <hch@lst.de>
Date: 2022-02-22 15:59:54
Also in: linux-crypto, linux-i2c, linux-mm, linux-s390, lkml

On Tue, Feb 22, 2022 at 09:42:22PM +0800, Baoquan He wrote:
In the old dma mapping, coherent mapping uses dma_alloc_coherent() to
allocate DMA buffer and mapping; while streaming mapping can only get
memory from slab or buddy allocator, then map with dma_map_single().
In that situation, dma_alloc_direct() checks a direct mapping for
coherent DMA, dma_map_direct() checks a direct mapping for streaming
DMA.

However, several new APIs have been added for streaming mapping, e.g
dma_alloc_pages(). These new APIs take care of DMA buffer allocating
and mapping which are similar with dma_alloc_coherent(). So we should
rename both of them to reflect their real intention to avoid confusion.

       dma_alloc_direct()  ==>  dma_coherent_direct()
       dma_map_direct()    ==>  dma_streaming_direct()
No, these new names are highly misleading.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help