mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: linux-kernel@vger.kernel.org
Subject: memory barriers and MMIO, once again...
Date: Sun, 16 Dec 2007 00:53:19 +0100	[thread overview]
Message-ID: <476468EF.8020201@s5r6.in-berlin.de> (raw)

Hi all,

in a single thread of execution, writel() and friends are ordered WRT
each other.  But I keep forgetting one thing:

Is writel() ordered WRT regular memory accesses?  That is, if I prepare
data in a coherent DMA buffer and then tell the device by writel() that
it's good to go, do I need a wmb() before the writel()?

*If* the answer to this is yes, then I also seem to need a wmb() between
dma_sync_single_for_device() and writel() if that writel tells the
device to use data from that synced DMA area, because the sync expands
to empty inline functions on simple architectures.  Or are there further
ordering guarantees on these architectures which eliminate the need for
a wmb() in this case?  If so, would I still need a barrier()?

Thanks,
-- 
Stefan Richter
-=====-=-=== ==-- =----
http://arcgraph.de/sr/

                 reply	other threads:[~2007-12-15 23:53 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=476468EF.8020201@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®