From: Daniel Jacobowitz <dan@debian.org>
To: linux-mips@linux-mips.org
Subject: Fix some (maybe) missing syncs in bitops.h
Date: Thu, 20 Jan 2005 20:04:03 -0500 [thread overview]
Message-ID: <20050121010403.GA10371@nevyn.them.org> (raw)
If I'm reading the broadcom documentation right, the semantics of set_bit
and test_and_set_bit require a sync at the end on this architecture.
I've been trying to track down a nasty signal delivery bug that I thought
was a TIF_SIGPENDING not being visible on the other CPU early enough. Turns
out that wasn't the problem, but I still think the syncs are correct, so I'm
posting the patch.
Signed-off-by: Daniel Jacobowitz <dan@codesourcery.com>
Index: linux/include/asm-mips/bitops.h
===================================================================
--- linux.orig/include/asm-mips/bitops.h 2005-01-20 16:31:45.921742674 -0500
+++ linux/include/asm-mips/bitops.h 2005-01-20 19:56:37.420056584 -0500
@@ -34,6 +34,7 @@
#include <asm/interrupt.h>
#include <asm/sgidefs.h>
#include <asm/war.h>
+#include <asm/system.h>
/*
* clear_bit() doesn't provide any barrier for the compiler.
@@ -76,6 +77,9 @@
" or %0, %2 \n"
" "__SC "%0, %1 \n"
" beqzl %0, 1b \n"
+#ifdef CONFIG_SMP
+ "sync \n"
+#endif
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
} else if (cpu_has_llsc) {
@@ -84,6 +88,9 @@
" or %0, %2 \n"
" "__SC "%0, %1 \n"
" beqz %0, 1b \n"
+#ifdef CONFIG_SMP
+ "sync \n"
+#endif
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
} else {
@@ -195,6 +204,9 @@
" xor %0, %2 \n"
" "__SC "%0, %1 \n"
" beqzl %0, 1b \n"
+#ifdef CONFIG_SMP
+ "sync \n"
+#endif
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
} else if (cpu_has_llsc) {
@@ -206,6 +218,9 @@
" xor %0, %2 \n"
" "__SC "%0, %1 \n"
" beqz %0, 1b \n"
+#ifdef CONFIG_SMP
+ "sync \n"
+#endif
: "=&r" (temp), "=m" (*m)
: "ir" (1UL << (nr & SZLONG_MASK)), "m" (*m));
} else {
--
Daniel Jacobowitz
next reply other threads:[~2005-01-21 1:04 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-01-21 1:04 Daniel Jacobowitz [this message]
2005-01-24 21:05 ` Fix some (maybe) missing syncs in bitops.h Ralf Baechle
2005-01-24 21:21 ` Daniel Jacobowitz
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=20050121010403.GA10371@nevyn.them.org \
--to=dan@debian.org \
--cc=linux-mips@linux-mips.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.