Messages in this thread | | | From | "陈华才" <> | Subject | Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN innon-coherent DMA mode | Date | Mon, 18 Sep 2017 14:55:08 +0800 |
| |
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"<hch@infradead.org>; Date: Mon, Sep 18, 2017 01:22 PM To: "Huacai Chen"<chenhc@lemote.com>; Cc: "Andrew Morton"<akpm@linux-foundation.org>; "Fuxin Zhang"<zhangfx@lemote.com>; "linux-mm"<linux-mm@kvack.org>; "linux-kernel"<linux-kernel@vger.kernel.org>; "stable"<stable@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. | |