[patch 1/2] powerpc: rmb fix

Nick Piggin npiggin at suse.de
Thu May 22 00:10:56 EST 2008


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 at 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)

More information about the Linuxppc-dev mailing list