LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] Fix MMIO ops to provide expected barrier behaviour
Date: Wed, 13 Sep 2006 12:41:01 +0200	[thread overview]
Message-ID: <4EB1450F-687F-472E-BFB0-4803B61617E0@kernel.crashing.org> (raw)
In-Reply-To: <17671.54461.77700.184852@cargo.ozlabs.ibm.com>

> This changes the writeX family of functions to have a sync instruction
> before the MMIO store rather than after, because the generally  
> expected
> behaviour is that the device receiving the MMIO store can be  
> guaranteed
> to see the effects of any preceding writes to normal memory.

Yay, progress!

> To preserve ordering between writeX and readX, the readX family of
> functions have had an eieio added before the load.

readX() is supposed to be ordered to memory as well; the only
example I can think of where the difference would would show is
a readX() setting off a DMA; maybe such devices do not exist
anyway, but if you care, the eieio should be a full sync.

> Although writeX followed by spin_unlock is not officially guaranteed
> to keep the writeX inside the spin-locked region unless an mmiowb()
> is used, there are currently drivers that depend on the previous
> behaviour on powerpc, which was that the mmiowb wasn't actually  
> required.
> Therefore we have a per-cpu flag that is set by writeX, cleared by
> __raw_spin_lock and mmiowb, and tested by __raw_spin_unlock.  If it is
> set, __raw_spin_unlock does a sync and clears it.

Why is this done on 64-bit systems only?


Segher

      reply	other threads:[~2006-09-13 10:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-09-13  9:51 [PATCH] Fix MMIO ops to provide expected barrier behaviour Paul Mackerras
2006-09-13 10:41 ` Segher Boessenkool [this message]

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=4EB1450F-687F-472E-BFB0-4803B61617E0@kernel.crashing.org \
    --to=segher@kernel.crashing.org \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=paulus@samba.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