From: Palmer Dabbelt Date: Tue, 28 Nov 2017 22:05:04 +0000 (-0800) Subject: RISC-V: Add READ_ONCE in arch_spin_is_locked() X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=21db403660d1433b8a02b26d5d4084921b857c40;p=openwrt%2Fstaging%2Fblogic.git RISC-V: Add READ_ONCE in arch_spin_is_locked() This was just incorrect in the original version. Signed-off-by: Palmer Dabbelt --- diff --git a/arch/riscv/include/asm/spinlock.h b/arch/riscv/include/asm/spinlock.h index 04c71d938afd..a6a005c4f2fb 100644 --- a/arch/riscv/include/asm/spinlock.h +++ b/arch/riscv/include/asm/spinlock.h @@ -24,7 +24,7 @@ /* FIXME: Replace this with a ticket lock, like MIPS. */ -#define arch_spin_is_locked(x) ((x)->lock != 0) +#define arch_spin_is_locked(x) (READ_ONCE((x)->lock) != 0) static inline void arch_spin_unlock(arch_spinlock_t *lock) {