summaryrefslogtreecommitdiff
path: root/arch/sparc/include/asm/setup.h
diff options
context:
space:
mode:
authorMikael Pettersson <mikpe@it.uu.se>2011-08-15 10:11:50 (GMT)
committerDavid S. Miller <davem@davemloft.net>2011-08-15 21:35:19 (GMT)
commit3f6aa0b113846a8628baa649af422cfc6fb1d786 (patch)
tree5b3d1f9b112a779dab37db5f685c24e5e857df96 /arch/sparc/include/asm/setup.h
parenta0fba3eb059e73fed2d376a901f8117734c12f1f (diff)
downloadlinux-fsl-qoriq-3f6aa0b113846a8628baa649af422cfc6fb1d786.tar.xz
sparc32: unbreak arch_write_unlock()
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>
Diffstat (limited to 'arch/sparc/include/asm/setup.h')
0 files changed, 0 insertions, 0 deletions