From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 12 Apr 2005 11:04:15 +0000 (+0000)
Subject: When simulating ll/sc compute the return EPC before modifying the
X-Git-Tag: firefly_0821_release~40855^2~1^2~232
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6dd04688520d7abe4883b2a79fa720291d76b140;p=firefly-linux-kernel-4.4.55.git

When simulating ll/sc compute the return EPC before modifying the
registers.

Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
---

diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index f9a6a5665559..77f796b9975e 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -408,9 +408,10 @@ static inline void simulate_ll(struct pt_regs *regs, unsigned int opcode)
 
 	preempt_enable();
 
+	compute_return_epc(regs);
+
 	regs->regs[(opcode & RT) >> 16] = value;
 
-	compute_return_epc(regs);
 	return;
 
 sig:
@@ -459,9 +460,9 @@ static inline void simulate_sc(struct pt_regs *regs, unsigned int opcode)
 		goto sig;
 	}
 
+	compute_return_epc(regs);
 	regs->regs[reg] = 1;
 
-	compute_return_epc(regs);
 	return;
 
 sig: