Skip to content

Commit 3df05fc

Browse files
npiggingregkh
authored andcommitted
powerpc/64: Fix smp_wmb barrier definition use use lwsync consistently
commit 0bfdf59 upstream. asm/barrier.h is not always included after asm/synch.h, which meant it was missing __SUBARCH_HAS_LWSYNC, so in some files smp_wmb() would be eieio when it should be lwsync. kernel/time/hrtimer.c is one case. __SUBARCH_HAS_LWSYNC is only used in one place, so just fold it in to where it's used. Previously with my small simulator config, 377 instances of eieio in the tree. After this patch there are 55. Fixes: 46d075b ("powerpc: Optimise smp_wmb") Cc: [email protected] # v2.6.29+ Signed-off-by: Nicholas Piggin <[email protected]> Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 1699bd0 commit 3df05fc

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

arch/powerpc/include/asm/barrier.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
#define rmb() __asm__ __volatile__ ("sync" : : : "memory")
3636
#define wmb() __asm__ __volatile__ ("sync" : : : "memory")
3737

38-
#ifdef __SUBARCH_HAS_LWSYNC
38+
/* The sub-arch has lwsync */
39+
#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC)
3940
# define SMPWMB LWSYNC
4041
#else
4142
# define SMPWMB eieio

arch/powerpc/include/asm/synch.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#include <linux/stringify.h>
77
#include <asm/feature-fixups.h>
88

9-
#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC)
10-
#define __SUBARCH_HAS_LWSYNC
11-
#endif
12-
139
#ifndef __ASSEMBLY__
1410
extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup;
1511
extern void do_lwsync_fixups(unsigned long value, void *fixup_start,

0 commit comments

Comments
 (0)