• Paul Burton's avatar
    MIPS: cmpxchg: Omit redundant barriers for Loongson3 · a91f2a1d
    Paul Burton authored
    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: default avatarPaul 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
    a91f2a1d
cmpxchg.h 8.53 KB