public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mbuesch@freenet.de>
To: Linus Torvalds <torvalds@osdl.org>
Cc: Paul Mackerras <paulus@samba.org>,
	akpm@osdl.org, mingo@redhat.com, alan@redhat.com,
	linux-arch@vger.kernel.org, linuxppc64-dev@ozlabs.org,
	linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>
Subject: Re: [PATCH] Document Linux's memory barriers [try #4]
Date: Fri, 10 Mar 2006 01:07:46 +0100	[thread overview]
Message-ID: <200603100107.46655.mbuesch@freenet.de> (raw)
In-Reply-To: <Pine.LNX.4.64.0603091554200.18022@g5.osdl.org>

[-- Attachment #1: Type: text/plain, Size: 1215 bytes --]

On Friday 10 March 2006 00:56, you wrote:
> 
> On Fri, 10 Mar 2006, Michael Buesch wrote:
> > 
> > So what about:
> > 
> > #define spin_lock_mmio(lock)	spin_lock(lock)
> > #define spin_unlock_mmio(lock)	do { spin_unlock(lock); mmiowb(); } while (0)
> 
> You need to put the mmiowb() inside the spinlock.

Ok, sorry. That was a typo.
I should not do more than 3 things at the same time. :)

> Yes, that is painful. But the point being that if it's outside, then when 
> somebody else gets the lock, the previous lock-owners MMIO stores may 
> still be in flight, which is what you didn't want in the first place.
> 
> Anyway, no need to make a new name for it, since you might as well just 
> use the mmiowb() explicitly. At least until this has been shown to be a 
> really common pattern (it clearly isn't, right now ;)

Ok, so maybe it is best if every device creates its own macros
for convenience (if needed => if it is a common pattern
in the scope of the driver).

Example:
#define bcm43xx_lock(bcm, flags)	spin_lock_irqsave(&(bcm)->lock, flags)
#define bcm43xx_unlock(bcm, flags)	do { mmiowb(); spin_unlock_irqrestore(&(bcm)->lock, flags); } while (0)

-- 
Greetings Michael.

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2006-03-10  0:08 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060315200956.4a9e2cb3.akpm@osdl.org>
2006-03-09 20:29 ` [PATCH] Document Linux's memory barriers [try #4] David Howells
2006-03-09 23:34   ` Paul Mackerras
2006-03-09 23:45     ` Michael Buesch
2006-03-09 23:56       ` Linus Torvalds
2006-03-10  0:07         ` Michael Buesch [this message]
2006-03-10  0:48     ` Alan Cox
2006-03-10  0:54       ` Paul Mackerras
2006-03-10 15:19     ` David Howells
2006-03-11  0:01       ` Paul Mackerras
2006-03-10  5:28   ` Nick Piggin
2006-03-15 11:10     ` David Howells
2006-03-15 11:51       ` Nick Piggin
2006-03-15 13:47         ` David Howells
2006-03-15 23:21           ` Nick Piggin
2006-03-12 17:15   ` Eric W. Biederman
2006-03-14 21:26     ` David Howells
2006-03-14 21:48       ` Paul Mackerras
2006-03-14 23:59         ` David Howells
2006-03-15  0:20           ` Linus Torvalds
2006-03-15  1:19             ` David Howells
2006-03-15  1:47               ` Linus Torvalds
2006-03-15  1:25             ` Nick Piggin
2006-03-15  0:54           ` Paul Mackerras
2006-03-15 14:23   ` [PATCH] Document Linux's memory barriers [try #5] David Howells
2006-03-16 23:17     ` Paul E. McKenney
2006-03-16 23:55       ` Linus Torvalds
2006-03-17  1:29         ` Paul E. McKenney
2006-03-17  5:32           ` Linus Torvalds
2006-03-17  6:23             ` Paul E. McKenney
2006-03-23 18:34       ` David Howells
2006-03-23 19:28         ` Linus Torvalds
2006-03-23 22:26         ` Paul E. McKenney
     [not found]     ` <21253.1142509812@warthog.cambridge.redhat.com>
     [not found]       ` <Pine.LNX.4.64.0603160914410.3618@g5.osdl.org>
2006-03-17  1:20         ` Nick Piggin

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=200603100107.46655.mbuesch@freenet.de \
    --to=mbuesch@freenet.de \
    --cc=akpm@osdl.org \
    --cc=alan@redhat.com \
    --cc=dhowells@redhat.com \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc64-dev@ozlabs.org \
    --cc=mingo@redhat.com \
    --cc=paulus@samba.org \
    --cc=torvalds@osdl.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