Re: [PATCH 07/11] powerpc: make dma_cache_sync a no-op

From
Christophe LEROY <hidden>
Date
2017-10-04 08:29:18
Also in
linux-iommu, linux-mips, linux-sh, lkml
Reply to
Christoph Hellwig, 2017-10-03

Le 03/10/2017 à 13:43, Christoph Hellwig a écrit :
On Tue, Oct 03, 2017 at 01:24:57PM +0200, Christophe LEROY wrote:
quoted
quoted
powerpc does not implement DMA_ATTR_NON_CONSISTENT allocations, so it
doesn't make any sense to do any work in dma_cache_sync given that it
must be a no-op when dma_alloc_attrs returns coherent memory.
What about arch/powerpc/mm/dma-noncoherent.c ?

Powerpc 8xx doesn't have coherent memory.
It doesn't implement the DMA_ATTR_NON_CONSISTENT interface either,
so if it really doesn't have a way to provide dma coherent allocation
(although the code in __dma_alloc_coherent suggests it does provide
dma coherent allocations) I have no idea how it could ever have
worked.
Yes indeed it provides coherent memory by allocation non cached memory.

And drivers aiming at using non coherent memory do it by using kmalloc() with GFP_DMA then dma_map_single().
Then they use dma_sync_single_for_xxx(), which calls __dma_sync() on the 8xx and is a nop on other powerpcs.

Christophe
Thread (23 messages) 23 messages, 5 authors, last reply 2017-10-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help