Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753330Ab2JPJaR (ORCPT ); Tue, 16 Oct 2012 05:30:17 -0400 Received: from mail-wi0-f178.google.com ([209.85.212.178]:36934 "EHLO mail-wi0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835Ab2JPJaP (ORCPT ); Tue, 16 Oct 2012 05:30:15 -0400 MIME-Version: 1.0 X-Originating-IP: [178.83.130.250] In-Reply-To: <1350309832-18461-1-git-send-email-m.szyprowski@samsung.com> References: <1350309832-18461-1-git-send-email-m.szyprowski@samsung.com> Date: Tue, 16 Oct 2012 11:30:14 +0200 Message-ID: Subject: Re: [Linaro-mm-sig] [RFC 0/2] DMA-mapping & IOMMU - physically contiguous allocations From: Daniel Vetter To: Marek Szyprowski Cc: linux-arm-kernel@lists.infradead.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Russell King - ARM Linux , Arnd Bergmann , Inki Dae , Kyungmin Park Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1711 Lines: 35 On Mon, Oct 15, 2012 at 4:03 PM, Marek Szyprowski wrote: > Some devices, which have IOMMU, for some use cases might require to > allocate a buffers for DMA which is contiguous in physical memory. Such > use cases appears for example in DRM subsystem when one wants to improve > performance or use secure buffer protection. > > I would like to ask if adding a new attribute, as proposed in this RFC > is a good idea? I feel that it might be an attribute just for a single > driver, but I would like to know your opinion. Should we look for other > solution? One thing to consider is that up to know all allocation constraints have been stored somewhere in struct device, either in the dma attributes (for the more generic stuff) or somewhere in platform specific data (e.g. for special cma pools). The design of dma_buf relies on this: The exporter/buffer allocator only sees all the struct device *devs that want to take part in sharing a given buffer. With this proposal some of these allocation constraints get moved to alloc time and aren't visible in the struct device any more. Now I that dma_buf isn't really there yet and no one has yet implemented a generic exporter that would allocate the dma_buf at the right spot for all cases, but I think we should consider this to not draw ourselves into an ugly api corner. Cheers, Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/