diff options
author | Palmer Dabbelt <palmer@sifive.com> | 2017-11-29 01:05:04 +0300 |
---|---|---|
committer | Palmer Dabbelt <palmer@sifive.com> | 2017-11-29 01:05:04 +0300 |
commit | 21db403660d1433b8a02b26d5d4084921b857c40 (patch) | |
tree | 0cdfbe952de30c914f146865fa6cb1bb899b5349 /arch/riscv/include | |
parent | 9347ce54cd699db92d37e66191aa4b9a0a92304e (diff) | |
download | linux-21db403660d1433b8a02b26d5d4084921b857c40.tar.xz |
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.h | 2 |
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) { |