]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: genex: Don't reload address unnecessarily
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:43 +0000 (21:53 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 7 Oct 2019 16:43:10 +0000 (09:43 -0700)
commitd7799c3fbb79e140cafb8998b1e4baa5dad55371
tree935dd727bf2d37a66ce20794cf1b9e24f6d472ae
parent3c4c929abb8be453daa47dfd0d15e59550d6bf8e
MIPS: genex: Don't reload address unnecessarily

In ejtag_debug_handler() we must reload the address of
ejtag_debug_buffer_spinlock if an sc fails, since the address in k0 will
have been clobbered by the result of the sc instruction. In the case
where we simply load a non-zero value (ie. there's contention for the
lock) the address will not be clobbered & we can simply branch back to
repeat the load from memory without reloading the address into k0.

The primary motivation for this change is that it moves the target of
the bnez instruction to an instruction within the LL/SC loop (the LL
itself), which we know contains no other memory accesses & therefore
isn't affected by Loongson3 LL/SC errata.

Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: linux-kernel@vger.kernel.org
arch/mips/kernel/genex.S