Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN innon-coherent DMA mode

2017-09-18 Thread 陈华才
Hi, Christoph,

Maybe you missed something.
1, pool_alloc_page() use dma_alloc_coherent() to allocate pool pages, and of 
course these pages are aligned to  ARCH_DMA_MINALIGN.
2, dma_pool_alloc() is the element allocator, but it doesn't use 
dma_alloc_coherent(). Elements only align to pool->size, but pool->size is 
usually less than ARCH_DMA_MINALIGN.
3, ARCH_DMA_MINALIGN is now only used in serveral drivers, no dma_ops use it.

Huacai
 
-- Original --
From:  "Christoph Hellwig"<h...@infradead.org>;
Date:  Mon, Sep 18, 2017 01:22 PM
To:  "Huacai Chen"<che...@lemote.com>;
Cc:  "Andrew Morton"<a...@linux-foundation.org>; "Fuxin 
Zhang"<zhan...@lemote.com>; "linux-mm"<linux...@kvack.org>; 
"linux-kernel"<linux-kernel@vger.kernel.org>; "stable"<sta...@vger.kernel.org>;
Subject:  Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN 
innon-coherent DMA mode
 
The dmapool code uses dma_alloc_coherent to allocate each element,
and dma_alloc_coherent must align to ARCH_DMA_MINALIGN already.
If you implementation doesn't do that it needs to be fixed.

Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN innon-coherent DMA mode

2017-09-18 Thread 陈华才
Hi, Christoph,

Maybe you missed something.
1, pool_alloc_page() use dma_alloc_coherent() to allocate pool pages, and of 
course these pages are aligned to  ARCH_DMA_MINALIGN.
2, dma_pool_alloc() is the element allocator, but it doesn't use 
dma_alloc_coherent(). Elements only align to pool->size, but pool->size is 
usually less than ARCH_DMA_MINALIGN.
3, ARCH_DMA_MINALIGN is now only used in serveral drivers, no dma_ops use it.

Huacai
 
-- Original --
From:  "Christoph Hellwig";
Date:  Mon, Sep 18, 2017 01:22 PM
To:  "Huacai Chen";
Cc:  "Andrew Morton"; "Fuxin 
Zhang"; "linux-mm"; 
"linux-kernel"; "stable";
Subject:  Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN 
innon-coherent DMA mode
 
The dmapool code uses dma_alloc_coherent to allocate each element,
and dma_alloc_coherent must align to ARCH_DMA_MINALIGN already.
If you implementation doesn't do that it needs to be fixed.