From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752372AbdIRGzT (ORCPT ); Mon, 18 Sep 2017 02:55:19 -0400 Received: from smtpbgsg2.qq.com ([54.254.200.128]:59510 "EHLO smtpbgsg2.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752220AbdIRGzS (ORCPT ); Mon, 18 Sep 2017 02:55:18 -0400 X-QQ-GoodBg: 0 X-QQ-SSF: 00100000000000F0 X-QQ-FEAT: I6xOSH5aO3c5Ge0w7Lju+O/pOKYkIh2tVLHFZSTeSYpb91vqK5FpuwCiq0QGW kWA1M+D9oszQZaPAeJIM7NlPwwl8R2QwPG287sMLZNRHqdYs1nYFsec9tiJyoC4dDSNiHzD Ev1fghfS2f6ByFts1NXYz1/MBQooEh1F4EpqliofsvO2khPPUjfs9nT8jBsBAts4nne2gIh g6j7CvqFGUIJYkBWo0BIFV+L/O9IiI8hY0SQCYnt/3zp0Ri2ROba0OFroXjADUVMXoGDUlS Xg8n6ftvN3aWkICVY51lItn/E= X-QQ-BUSINESS-ORIGIN: 2 X-Originating-IP: 222.92.124.153 X-QQ-STYLE: X-QQ-mid: bizmailfree34t1505717708t4763 From: "=?utf-8?B?6ZmI5Y2O5omN?=" To: "=?utf-8?B?Q2hyaXN0b3BoIEhlbGx3aWc=?=" Cc: "=?utf-8?B?QW5kcmV3IE1vcnRvbg==?=" , "=?utf-8?B?RnV4aW4gWmhhbmc=?=" , "=?utf-8?B?bGludXgtbW0=?=" , "=?utf-8?B?bGludXgta2VybmVs?=" , "=?utf-8?B?c3RhYmxl?=" Subject: Re: [PATCH V5 2/3] mm: dmapool: Align to ARCH_DMA_MINALIGN innon-coherent DMA mode Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Date: Mon, 18 Sep 2017 14:55:08 +0800 X-Priority: 3 Message-ID: X-QQ-MIME: TCMime 1.0 by Tencent X-Mailer: QQMail 2.x X-QQ-Mailer: QQMail 2.x References: <1505708548-4750-1-git-send-email-chenhc@lemote.com> <20170918052208.GB29118@infradead.org> In-Reply-To: <20170918052208.GB29118@infradead.org> X-QQ-ReplyHash: 3777447912 X-QQ-SENDSIZE: 520 Feedback-ID: bizmailfree:lemote.com:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id v8I6tPhr004081 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.