aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv/include
diff options
context:
space:
mode:
authorPalmer Dabbelt2017-11-28 14:05:04 -0800
committerPalmer Dabbelt2017-11-28 14:05:04 -0800
commit21db403660d1433b8a02b26d5d4084921b857c40 (patch)
tree0cdfbe952de30c914f146865fa6cb1bb899b5349 /arch/riscv/include
parent9347ce54cd699db92d37e66191aa4b9a0a92304e (diff)
RISC-V: Add READ_ONCE in arch_spin_is_locked()
This was just incorrect in the original version. Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
Diffstat (limited to 'arch/riscv/include')
-rw-r--r--arch/riscv/include/asm/spinlock.h2
1 files changed, 1 insertions, 1 deletions
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)
{