]> git.baikalelectronics.ru Git - kernel.git/commit
MIPS: cmpxchg: Omit redundant barriers for Loongson3
authorPaul Burton <paul.burton@mips.com>
Tue, 1 Oct 2019 21:53:38 +0000 (21:53 +0000)
committerPaul Burton <paul.burton@mips.com>
Mon, 7 Oct 2019 16:43:01 +0000 (09:43 -0700)
commitf03337922c9e8269dda47678682d16012e00bc44
tree4cda928500a1d8ca12e75a80370ec33d03112291
parentb6914b09a506ad339ddace68e290c39f8f5d970a
MIPS: cmpxchg: Omit redundant barriers for Loongson3

When building a kernel configured to support Loongson3 LL/SC workarounds
(ie. CONFIG_CPU_LOONGSON3_WORKAROUNDS=y) the inline assembly in
__xchg_asm() & __cmpxchg_asm() already emits completion barriers, and as
such we don't need to emit extra barriers from the xchg() or cmpxchg()
macros. Add compile-time constant checks causing us to omit the
redundant memory barriers.

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/include/asm/cmpxchg.h