linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [patch 1/2] powerpc: rmb fix
@ 2008-05-21 14:10 Nick Piggin
  2008-05-21 14:12 ` [patch 2/2] powerpc: optimise smp_wmb Nick Piggin
  2008-05-21 15:27 ` [patch 1/2] powerpc: rmb fix Benjamin Herrenschmidt
  0 siblings, 2 replies; 36+ messages in thread
From: Nick Piggin @ 2008-05-21 14:10 UTC (permalink / raw)
  To: paulus, linuxppc-dev

Hi,

I'm sure I've sent these patches before, but I can't remember why they
weren't merged. They still seem obviously correct to me.

--

lwsync is explicitly defined not to have any effect on the ordering of
accesses to device memory, so it cannot be used for rmb(). sync appears
to be the only barrier which fits the bill.

Signed-off-by: Nick Piggin <npiggin@suse.de>
---
Index: linux-2.6/include/asm-powerpc/system.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/system.h
+++ linux-2.6/include/asm-powerpc/system.h
@@ -34,7 +34,7 @@
  * SMP since it is only used to order updates to system memory.
  */
 #define mb()   __asm__ __volatile__ ("sync" : : : "memory")
-#define rmb()  __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
+#define rmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define read_barrier_depends()  do { } while(0)
 

^ permalink raw reply	[flat|nested] 36+ messages in thread
* [patch 1/2] powerpc: rmb fix
@ 2007-08-21  2:11 Nick Piggin
  2007-08-21 19:07 ` Joel Schopp
  0 siblings, 1 reply; 36+ messages in thread
From: Nick Piggin @ 2007-08-21  2:11 UTC (permalink / raw)
  To: linuxppc-dev; +Cc: Paul Mackerras

In the interest of completeness, I'll split these patches up and submit to
the powerpc dev list. Any discussion or ack/nack would be appreciated.

---
lwsync is defined to only order memory operations on cacheable memory.
A full sync appears to be the only barrier that will order all memory
loads including device memory.

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

Index: linux-2.6/include/asm-powerpc/system.h
===================================================================
--- linux-2.6.orig/include/asm-powerpc/system.h
+++ linux-2.6/include/asm-powerpc/system.h
@@ -33,7 +33,7 @@
  * SMP since it is only used to order updates to system memory.
  */
 #define mb()   __asm__ __volatile__ ("sync" : : : "memory")
-#define rmb()  __asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
+#define rmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define wmb()  __asm__ __volatile__ ("sync" : : : "memory")
 #define read_barrier_depends()  do { } while(0)
 
@@ -42,7 +42,7 @@
 #ifdef __KERNEL__
 #ifdef CONFIG_SMP
 #define smp_mb()	mb()
-#define smp_rmb()	rmb()
+#define smp_rmb()	__asm__ __volatile__ (__stringify(LWSYNC) : : : "memory")
 #define smp_wmb()	eieio()
 #define smp_read_barrier_depends()	read_barrier_depends()
 #else

^ permalink raw reply	[flat|nested] 36+ messages in thread

end of thread, other threads:[~2008-05-26  1:38 UTC | newest]

Thread overview: 36+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21 14:10 [patch 1/2] powerpc: rmb fix Nick Piggin
2008-05-21 14:12 ` [patch 2/2] powerpc: optimise smp_wmb Nick Piggin
2008-05-21 15:26   ` Benjamin Herrenschmidt
2008-05-21 15:34     ` Nick Piggin
2008-05-21 15:43       ` Benjamin Herrenschmidt
2008-05-21 15:47         ` Nick Piggin
2008-05-21 16:02           ` Benjamin Herrenschmidt
2008-05-21 20:51             ` Segher Boessenkool
2008-05-21 16:01         ` Nick Piggin
2008-05-21 20:12           ` Segher Boessenkool
2008-05-21 20:44             ` Benjamin Herrenschmidt
2008-05-21 22:07               ` Segher Boessenkool
2008-05-22  0:30             ` Nick Piggin
2008-05-21 20:16   ` Segher Boessenkool
2008-05-21 15:27 ` [patch 1/2] powerpc: rmb fix Benjamin Herrenschmidt
2008-05-21 15:32   ` Nick Piggin
2008-05-21 15:43     ` Benjamin Herrenschmidt
2008-05-23  2:14     ` Paul Mackerras
2008-05-23  4:40       ` Nick Piggin
2008-05-23  4:53         ` Paul Mackerras
2008-05-23  5:48           ` Nick Piggin
2008-05-23  6:40             ` Paul Mackerras
2008-05-26  1:38               ` Nick Piggin
  -- strict thread matches above, loose matches on Subject: below --
2007-08-21  2:11 Nick Piggin
2007-08-21 19:07 ` Joel Schopp
2007-08-21 19:43   ` Segher Boessenkool
2007-08-21 21:42     ` Linas Vepstas
2007-08-22  1:16     ` Nick Piggin
2007-08-22  3:29       ` Segher Boessenkool
2007-08-22  3:55         ` Nick Piggin
2007-08-23 17:57           ` Segher Boessenkool
2007-08-24  2:47             ` Nick Piggin
2007-08-22  3:15     ` Nick Piggin
2007-08-22  3:33       ` Segher Boessenkool
2007-08-22  4:05         ` Nick Piggin
2007-08-23 17:49           ` Segher Boessenkool

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).