diff options
author | Mikael Pettersson <mikpe@it.uu.se> | 2011-08-15 10:11:50 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-03 11:39:59 -0700 |
commit | 7fe1e169829030a8257be59636f82c45753ca941 (patch) | |
tree | 1e24f9473aa728b65b5ddfbfa5956db22a6ee52a /arch/sparc/kernel/Makefile | |
parent | b60c440fff5c9e6dd8d328617b79b7fd57aed9b1 (diff) | |
download | kernel_samsung_aries-7fe1e169829030a8257be59636f82c45753ca941.zip kernel_samsung_aries-7fe1e169829030a8257be59636f82c45753ca941.tar.gz kernel_samsung_aries-7fe1e169829030a8257be59636f82c45753ca941.tar.bz2 |
sparc32: unbreak arch_write_unlock()
commit 3f6aa0b113846a8628baa649af422cfc6fb1d786 upstream.
The sparc32 version of arch_write_unlock() is just a plain assignment.
Unfortunately this allows the compiler to schedule side-effects in a
protected region to occur after the HW-level unlock, which is broken.
E.g., the following trivial test case gets miscompiled:
#include <linux/spinlock.h>
rwlock_t lock;
int counter;
void foo(void) { write_lock(&lock); ++counter; write_unlock(&lock); }
Fixed by adding a compiler memory barrier to arch_write_unlock(). The
sparc64 version combines the barrier and assignment into a single asm(),
and implements the operation as a static inline, so that's what I did too.
Compile-tested with sparc32_defconfig + CONFIG_SMP=y.
Signed-off-by: Mikael Pettersson <mikpe@it.uu.se>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'arch/sparc/kernel/Makefile')
0 files changed, 0 insertions, 0 deletions