diff options
author | James Hogan <james.hogan@imgtec.com> | 2017-05-31 18:19:47 +0300 |
---|---|---|
committer | Ben Hutchings <ben@decadent.org.uk> | 2017-10-12 17:27:11 +0300 |
commit | ff676dae89c7329cf6f8900da759eb44ad063b26 (patch) | |
tree | 7f5b58f671ee47665c96357f70a5fef3aa0efe8d /arch | |
parent | 75dca988a2ab7b00d4ab1fc405ad82546fa8d93e (diff) | |
download | linux-ff676dae89c7329cf6f8900da759eb44ad063b26.tar.xz |
MIPS: Fix mips_atomic_set() retry condition
commit 2ec420b26f7b6ff332393f0bb5a7d245f7ad87f0 upstream.
The inline asm retry check in the MIPS_ATOMIC_SET operation of the
sysmips system call has been backwards since commit f1e39a4a616c ("MIPS:
Rewrite sysmips(MIPS_ATOMIC_SET, ...) in C with inline assembler")
merged in v2.6.32, resulting in the non R10000_LLSC_WAR case retrying
until the operation was inatomic, before returning the new value that
was probably just written multiple times instead of the old value.
Invert the branch condition to fix that particular issue.
Fixes: f1e39a4a616c ("MIPS: Rewrite sysmips(MIPS_ATOMIC_SET, ...) in C with inline assembler")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/16148/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/mips/kernel/syscall.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index d02765708ddb..4e40a90f2446 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c @@ -203,7 +203,7 @@ static inline int mips_atomic_set(struct pt_regs *regs, "1: ll %[old], (%[addr]) \n" " move %[tmp], %[new] \n" "2: sc %[tmp], (%[addr]) \n" - " bnez %[tmp], 4f \n" + " beqz %[tmp], 4f \n" "3: \n" " .subsection 2 \n" "4: b 1b \n" |