From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752877AbdF0PWs (ORCPT ); Tue, 27 Jun 2017 11:22:48 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:34360 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752276AbdF0PWp (ORCPT ); Tue, 27 Jun 2017 11:22:45 -0400 Date: Tue, 27 Jun 2017 08:22:42 -0700 From: Christoph Hellwig To: Robin Murphy Cc: Christoph Hellwig , Vladimir Murzin , 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, 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: <20170627152242.GB29664@infradead.org> References: <1495621472-9323-1-git-send-email-vladimir.murzin@arm.com> <1495621472-9323-5-git-send-email-vladimir.murzin@arm.com> <20170620134932.GB31496@infradead.org> <3d5ea779-90a3-f0b5-b9aa-161d4c0855e7@arm.com> <20170626094250.GB21570@infradead.org> <9ae32e85-dd35-ea04-5c9f-4dc6d1358a99@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ae32e85-dd35-ea04-5c9f-4dc6d1358a99@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 On Tue, Jun 27, 2017 at 03:36:16PM +0100, Robin Murphy wrote: > I admit I'm almost in agreement, were it not for the fact that > dma-contiguous already supports all four combinations of both per-device > and global pools, and both reserved mem and direct declarations from > arch/platform code, all through the same interface to boot, and nobody's > complaining about that. The only real difference for dma-coherent seems > to be the way it's baked into the existing API. > > If it is just a matter of interfaces, I'd have no objection to exporting > a separate e.g. dma_alloc_from_global_coherent() or somesuch as a > conceptually separate interface to dma_coherent_default_memory, which > the arch code can then call from ->alloc in the same manner they > currently call dma_alloc_from_contiguous(). That seems like a reasonable > way to keep the per-device and global pools conceptually distinct > without needlessly duplicating implementations. In fact, I'm now > wondering if the regular arm/arm64 atomic pools couldn't also make use > of such a thing as well... Ok. I think I'll just go ahead with the current patches, and then we'll try to come up with something better later. I really don't want it in actual arch code, but I want it controlled from the dma_map_ops instance instead of from generic code. There will be a lot of churn in this area if my plans go ahead, so I think we can handle it then.