Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753904AbZICIgY (ORCPT ); Thu, 3 Sep 2009 04:36:24 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753676AbZICIgY (ORCPT ); Thu, 3 Sep 2009 04:36:24 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:58216 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753586AbZICIgX (ORCPT ); Thu, 3 Sep 2009 04:36:23 -0400 Date: Thu, 3 Sep 2009 09:36:00 +0100 From: Russell King - ARM Linux To: Imre Deak Cc: ext Laurent Pinchart , Steven Walter , David Xiao , Ben Dooks , Hugh Dickins , Robin Holt , "linux-kernel@vger.kernel.org" , v4l2_linux , "linux-arm-kernel@lists.arm.linux.org.uk" Subject: Re: How to efficiently handle DMA and cache on ARMv7 ? (was "Is get_user_pages() enough to prevent pages from being swapped out ?") Message-ID: <20090903083600.GA7235@n2100.arm.linux.org.uk> References: <200908061208.22131.laurent.pinchart@ideasonboard.com> <20090901132824.GN19719@n2100.arm.linux.org.uk> <200909011543.48439.laurent.pinchart@ideasonboard.com> <20090902151044.GG30183@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090902151044.GG30183@localhost> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1006 Lines: 23 On Wed, Sep 02, 2009 at 06:10:44PM +0300, Imre Deak wrote: > To my understanding buffers returned by dma_alloc_*, kmalloc, vmalloc > are ok: For dma_map_*, the only pages/addresses which are valid to pass are those returned by get_free_pages() or kmalloc. Everything else is not permitted. Use of vmalloc'd and dma_alloc_* pages with the dma_map_* APIs is invalid use of the DMA API. See the notes in the DMA-mapping.txt document against "dma_map_single". > For user mappings I think you'd have to do an additional flush for > the direct mapping, while the user mapping is flushed in dma_map_*. I will not accept a patch which adds flushing of anything other than the kernel direct mapping in the dma_map_* functions, so please find a different approach. -- 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/