Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756610AbYC0FNh (ORCPT ); Thu, 27 Mar 2008 01:13:37 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751361AbYC0FN2 (ORCPT ); Thu, 27 Mar 2008 01:13:28 -0400 Received: from idcmail-mo1so.shaw.ca ([24.71.223.10]:2249 "EHLO pd3mo1so.prod.shaw.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751341AbYC0FN1 (ORCPT ); Thu, 27 Mar 2008 01:13:27 -0400 Date: Wed, 26 Mar 2008 23:15:19 -0600 From: Robert Hancock Subject: Re: memory-barriers.txt: cache coherency vs mmio In-reply-to: To: Stefan Richter Cc: linux-kernel@vger.kernel.org Message-id: <47EB2D67.9090609@shaw.ca> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 29 Stefan Richter wrote: > The subject section in memory-barriers.txt says: > > "[...] MMIO accesses may, in effect, overtake accesses to cached memory > that were emitted earlier. A memory barrier isn't sufficient in such a > case, but rather the cache must be flushed between the cached memory > write and the MMIO access if the two are in any way dependent." > > And the lowly driver programmer immediately asks: > How do I flush the cache? > > In particular, do I have to do anyhing between > > coherent_dma_buffer->datum = something; > > writel(YOU_CAN_START_DMA_NOW, register); > > Thanks, That part of the document seems kind of bogus to me. Or rather, if it's true and there are architectures where ordering between normal memory writes and MMIO is not ensured even with wmb(), that's the bogus part. Driver authors should not have to deal with that sort of thing. -- 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/