From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754474Ab0G0M6u (ORCPT ); Tue, 27 Jul 2010 08:58:50 -0400 Received: from tex.lwn.net ([70.33.254.29]:34178 "EHLO vena.lwn.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752377Ab0G0M6p (ORCPT ); Tue, 27 Jul 2010 08:58:45 -0400 Date: Tue, 27 Jul 2010 06:58:42 -0600 From: Jonathan Corbet To: Marek Szyprowski Cc: "'Russell King - ARM Linux'" , Michal Nazarewicz , linux-mm@kvack.org, "'Daniel Walker'" , Pawel Osciak , "'Mark Brown'" , linux-kernel@vger.kernel.org, "'Hiremath Vaibhav'" , "'FUJITA Tomonori'" , "'Kyungmin Park'" , "'Zach Pfeffer'" , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCHv2 2/4] mm: cma: Contiguous Memory Allocator added Message-ID: <20100727065842.40ae76c8@bike.lwn.net> In-Reply-To: <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> References: <743102607e2c5fb20e3c0676fadbcb93d501a78e.1280151963.git.m.nazarewicz@samsung.com> <20100727120841.GC11468@n2100.arm.linux.org.uk> <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> Organization: LWN.net X-Mailer: Claws Mail 3.7.6 (GTK+ 2.21.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Jul 2010 14:45:58 +0200 Marek Szyprowski wrote: > > How does one obtain the CPU address of this memory in order for the CPU > > to access it? > > Right, we did not cover such case. In CMA approach we tried to separate > memory allocation from the memory mapping into user/kernel space. Mapping > a buffer is much more complicated process that cannot be handled in a > generic way, so we decided to leave this for the device drivers. Usually > video processing devices also don't need in-kernel mapping for such > buffers at all. Still...that *is* why I suggested an interface which would return both the DMA address and a kernel-space virtual address, just like the DMA API does... Either that, or just return the void * kernel address and let drivers do the DMA mapping themselves. Returning only the dma_addr_t address will make the interface difficult to use in many situations. jon From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail137.messagelabs.com (mail137.messagelabs.com [216.82.249.19]) by kanga.kvack.org (Postfix) with ESMTP id AC92E60080D for ; Tue, 27 Jul 2010 08:58:46 -0400 (EDT) Date: Tue, 27 Jul 2010 06:58:42 -0600 From: Jonathan Corbet Subject: Re: [PATCHv2 2/4] mm: cma: Contiguous Memory Allocator added Message-ID: <20100727065842.40ae76c8@bike.lwn.net> In-Reply-To: <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> References: <743102607e2c5fb20e3c0676fadbcb93d501a78e.1280151963.git.m.nazarewicz@samsung.com> <20100727120841.GC11468@n2100.arm.linux.org.uk> <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Sender: owner-linux-mm@kvack.org To: Marek Szyprowski Cc: 'Russell King - ARM Linux' , Michal Nazarewicz , linux-mm@kvack.org, 'Daniel Walker' , Pawel Osciak , 'Mark Brown' , linux-kernel@vger.kernel.org, 'Hiremath Vaibhav' , 'FUJITA Tomonori' , 'Kyungmin Park' , 'Zach Pfeffer' , linux-media@vger.kernel.org, linux-arm-kernel@lists.infradead.org List-ID: On Tue, 27 Jul 2010 14:45:58 +0200 Marek Szyprowski wrote: > > How does one obtain the CPU address of this memory in order for the CPU > > to access it? > > Right, we did not cover such case. In CMA approach we tried to separate > memory allocation from the memory mapping into user/kernel space. Mapping > a buffer is much more complicated process that cannot be handled in a > generic way, so we decided to leave this for the device drivers. Usually > video processing devices also don't need in-kernel mapping for such > buffers at all. Still...that *is* why I suggested an interface which would return both the DMA address and a kernel-space virtual address, just like the DMA API does... Either that, or just return the void * kernel address and let drivers do the DMA mapping themselves. Returning only the dma_addr_t address will make the interface difficult to use in many situations. jon -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: corbet@lwn.net (Jonathan Corbet) Date: Tue, 27 Jul 2010 06:58:42 -0600 Subject: [PATCHv2 2/4] mm: cma: Contiguous Memory Allocator added In-Reply-To: <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> References: <743102607e2c5fb20e3c0676fadbcb93d501a78e.1280151963.git.m.nazarewicz@samsung.com> <20100727120841.GC11468@n2100.arm.linux.org.uk> <003701cb2d89$adae4580$090ad080$%szyprowski@samsung.com> Message-ID: <20100727065842.40ae76c8@bike.lwn.net> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Tue, 27 Jul 2010 14:45:58 +0200 Marek Szyprowski wrote: > > How does one obtain the CPU address of this memory in order for the CPU > > to access it? > > Right, we did not cover such case. In CMA approach we tried to separate > memory allocation from the memory mapping into user/kernel space. Mapping > a buffer is much more complicated process that cannot be handled in a > generic way, so we decided to leave this for the device drivers. Usually > video processing devices also don't need in-kernel mapping for such > buffers at all. Still...that *is* why I suggested an interface which would return both the DMA address and a kernel-space virtual address, just like the DMA API does... Either that, or just return the void * kernel address and let drivers do the DMA mapping themselves. Returning only the dma_addr_t address will make the interface difficult to use in many situations. jon