public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Robert Hancock <hancockr@shaw.ca>
To: Stefan Richter <stefanr@s5r6.in-berlin.de>
Cc: linux-kernel@vger.kernel.org
Subject: Re: memory-barriers.txt: cache coherency vs mmio
Date: Wed, 26 Mar 2008 23:15:19 -0600	[thread overview]
Message-ID: <47EB2D67.9090609@shaw.ca> (raw)
In-Reply-To: <fa.I0PBRKboi+ZcSNf2wJaKd5/Lavw@ifi.uio.no>

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.


       reply	other threads:[~2008-03-27  5:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <fa.I0PBRKboi+ZcSNf2wJaKd5/Lavw@ifi.uio.no>
2008-03-27  5:15 ` Robert Hancock [this message]
2008-03-26 21:09 memory-barriers.txt: cache coherency vs mmio Stefan Richter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EB2D67.9090609@shaw.ca \
    --to=hancockr@shaw.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefanr@s5r6.in-berlin.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox