Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752095AbdFTNtg (ORCPT ); Tue, 20 Jun 2017 09:49:36 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:39691 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbdFTNte (ORCPT ); Tue, 20 Jun 2017 09:49:34 -0400 Date: Tue, 20 Jun 2017 06:49:32 -0700 From: Christoph Hellwig To: Vladimir Murzin Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux@armlinux.org.uk, sza@esh.hu, arnd@arndb.de, gregkh@linuxfoundation.org, akpm@linux-foundation.org, alexandre.torgue@st.com, robin.murphy@arm.com, benjamin.gaignard@linaro.org, kbuild-all@01.org, Michal Nazarewicz , Marek Szyprowski , Rob Herring , Mark Rutland Subject: Re: [PATCH v5 4/7] drivers: dma-coherent: Introduce default DMA pool Message-ID: <20170620134932.GB31496@infradead.org> References: <1495621472-9323-1-git-send-email-vladimir.murzin@arm.com> <1495621472-9323-5-git-send-email-vladimir.murzin@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1495621472-9323-5-git-send-email-vladimir.murzin@arm.com> User-Agent: Mutt/1.8.0 (2017-02-23) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 741 Lines: 15 On Wed, May 24, 2017 at 11:24:29AM +0100, Vladimir Murzin wrote: > This patch introduces default coherent DMA pool similar to default CMA > area concept. To keep other users safe code kept under CONFIG_ARM. I don't see a CONFIG_ARM in the code, although parts of it are added under CONFIG_OF_RESERVED_MEM. But overall this code look a bit odd to me. As far as I can tell the dma-coherent.c code is for the case where we have a special piece of coherent memory close to a device. If you're allocating out of the global allocator the memory should come from the normal dma_ops ->alloc allocator - and also take the attrs into account (e.g. for DMA_ATTR_NON_CONSISTENT or DMA_ATTR_NO_KERNEL_MAPPING requests you don't need coherent memory)