Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756427AbZGGRgc (ORCPT ); Tue, 7 Jul 2009 13:36:32 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754087AbZGGRgZ (ORCPT ); Tue, 7 Jul 2009 13:36:25 -0400 Received: from caramon.arm.linux.org.uk ([78.32.30.218]:47879 "EHLO caramon.arm.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752693AbZGGRgY (ORCPT ); Tue, 7 Jul 2009 13:36:24 -0400 Date: Tue, 7 Jul 2009 18:36:05 +0100 From: Russell King - ARM Linux To: Arnd Bergmann Cc: Ming Lei , Alan Cox , Joerg Roedel , fujita.tomonori@lab.ntt.co.jp, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, linux-arm-kernel Subject: Re: [PATCH][RFC] asm-generic:remove calling flush_write_buffers() in dma_sync_*_for_cpu Message-ID: <20090707173605.GB18504@n2100.arm.linux.org.uk> References: <1246199959-6548-1-git-send-email-tom.leiming@gmail.com> <20090707074821.GB6995@n2100.arm.linux.org.uk> <200907071606.48933.arnd@arndb.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200907071606.48933.arnd@arndb.de> 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: 919 Lines: 18 On Tue, Jul 07, 2009 at 04:06:48PM +0200, Arnd Bergmann wrote: > Note that actually you need to do writeback+invalidate in DMA_TO_DEVICE Rubbish. DMA _to_ the device just needs any data held in the cache to be pushed out into the hardware RAM. There's absolutely no point in invalidating it - that's a complete waste of time. > and at least an invalidate in DMA_FROM_DEVICE during dma_map_*. > For the unmap, I don't think you ever need to invalidate the cache. As I've already explained, you do if you have speculative prefetching which can bring in data into the cache from _any_ memory location at _any_ time. We _are_ going to have to do this, no questions asked. -- 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/