All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Nick Piggin <npiggin@suse.de>, Linux Arch <linux-arch@vger.kernel.org>
Subject: [patch 2/8] alpha: fix bitops
Date: Tue, 28 Aug 2007 18:15:14 +1000	[thread overview]
Message-ID: <20070828081514.13582.92109.sendpatchset@linux.local0.net> (raw)
In-Reply-To: <20070828081453.13582.258.sendpatchset@linux.local0.net>

Documentation/atomic_ops.txt defines these primitives must contain a memory
barrier both before and after their memory operation. This is consistent with
the atomic ops implementation on alpha.

Signed-off-by: Nick Piggin <npiggin@suse.de>

---
 include/asm-alpha/bitops.h |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: linux-2.6/include/asm-alpha/bitops.h
===================================================================
--- linux-2.6.orig/include/asm-alpha/bitops.h
+++ linux-2.6/include/asm-alpha/bitops.h
@@ -117,6 +117,9 @@ test_and_set_bit(unsigned long nr, volat
 	int *m = ((int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
+#ifdef CONFIG_SMP
+	"	mb\n"
+#endif
 	"1:	ldl_l %0,%4\n"
 	"	and %0,%3,%2\n"
 	"	bne %2,2f\n"
@@ -158,6 +161,9 @@ test_and_clear_bit(unsigned long nr, vol
 	int *m = ((int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
+#ifdef CONFIG_SMP
+	"	mb\n"
+#endif
 	"1:	ldl_l %0,%4\n"
 	"	and %0,%3,%2\n"
 	"	beq %2,2f\n"
@@ -199,6 +205,9 @@ test_and_change_bit(unsigned long nr, vo
 	int *m = ((int *) addr) + (nr >> 5);
 
 	__asm__ __volatile__(
+#ifdef CONFIG_SMP
+	"	mb\n"
+#endif
 	"1:	ldl_l %0,%4\n"
 	"	and %0,%3,%2\n"
 	"	xor %0,%3,%0\n"

  parent reply	other threads:[~2007-08-28  8:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-28  8:14 [patch 0/8] lock bitops and some bitops fixes Nick Piggin
2007-08-28  8:15 ` [patch 1/8] bitops: introduce lock ops Nick Piggin
2007-08-28  8:15 ` Nick Piggin [this message]
2007-08-28  8:15 ` [patch 3/8] alpha: lock bitops Nick Piggin
2007-08-28  8:15 ` [patch 4/8] ia64: " Nick Piggin
2007-08-28  8:15 ` [patch 5/8] mips: fix bitops Nick Piggin
2007-08-28  8:15 ` [patch 6/8] mips: lock bitops Nick Piggin
2007-08-28  8:16 ` [patch 7/8] powerpc: " Nick Piggin
2007-08-28  8:16 ` [patch 8/8] bit_spin_lock: use " Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2007-08-04 20:28 [patch 0/8] lock bitops and some bitops fixes Nick Piggin
2007-08-04 20:28 ` [patch 2/8] alpha: fix bitops 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=20070828081514.13582.92109.sendpatchset@linux.local0.net \
    --to=npiggin@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=linux-arch@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.