From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Sat, 24 Dec 2011 08:01:41 +0100 (CET) Received: from gate.crashing.org ([63.228.1.57]:42020 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S1903559Ab1LXHA4 (ORCPT ); Sat, 24 Dec 2011 08:00:56 +0100 Received: from [IPv6:::1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id pBO70F5h021853; Sat, 24 Dec 2011 01:00:16 -0600 Message-ID: <1324710014.6632.23.camel@pasglop> Subject: Re: [PATCH 00/14] DMA-mapping framework redesign preparation From: Benjamin Herrenschmidt To: Matthew Wilcox Cc: Marek Szyprowski , linux-kernel@vger.kernel.org, Thomas Gleixner , Andrew Morton , Arnd Bergmann , Stephen Rothwell , microblaze-uclinux@itee.uq.edu.au, linux-arch@vger.kernel.org, x86@kernel.org, linux-sh@vger.kernel.org, linux-alpha@vger.kernel.org, sparclinux@vger.kernel.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-mips@linux-mips.org, discuss@x86-64.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linaro-mm-sig@lists.linaro.org, Jonathan Corbet , Kyungmin Park , Andrzej Pietrasiewicz Date: Sat, 24 Dec 2011 18:00:14 +1100 In-Reply-To: <20111223163516.GO20129@parisc-linux.org> References: <1324643253-3024-1-git-send-email-m.szyprowski@samsung.com> <20111223163516.GO20129@parisc-linux.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.2.2- Content-Transfer-Encoding: 7bit Mime-Version: 1.0 X-archive-position: 32191 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: benh@kernel.crashing.org Precedence: bulk X-list: linux-mips Return-Path: X-Keywords: X-UID: 19287 On Fri, 2011-12-23 at 09:35 -0700, Matthew Wilcox wrote: > I really think this wants to be a separate function. > dma_alloc_coherent > is for allocating memory to be shared between the kernel and a driver; > we already have dma_map_sg for mapping userspace I/O as an alternative > interface. This feels like it's something different again rather than > an option to dma_alloc_coherent. Depends. There can be some interesting issues with some of the ARM stuff out there (and to a lesser extent older ppc embedded stuff). For example, some devices really want a physically contiguous chunk, and are not cache coherent. In that case, you can't keep the linear mapping around. But you also don't waste your precious kernel virtual space creating a separate non-cachable mapping for those. In general, dma mapping attributes as a generic feature make sense, whether this specific attribute does or not though. And we probably want space for platform specific attributes, for example, FSL embedded iommu's have "interesting" features for directing data toward a specific core cache etc... that we might want to expose using such attributes. Cheers, Ben.