summaryrefslogtreecommitdiff
path: root/arch/riscv
diff options
context:
space:
mode:
authorPalmer Dabbelt <palmer@sifive.com>2017-11-28 14:05:04 -0800
committerPalmer Dabbelt <palmer@sifive.com>2017-11-28 14:05:04 -0800
commit21db403660d1433b8a02b26d5d4084921b857c40 (patch)
tree0cdfbe952de30c914f146865fa6cb1bb899b5349 /arch/riscv
parent9347ce54cd699db92d37e66191aa4b9a0a92304e (diff)
downloadlwn-21db403660d1433b8a02b26d5d4084921b857c40.tar.gz
lwn-21db403660d1433b8a02b26d5d4084921b857c40.zip
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')
-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)
{