Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

MIPS: asm: local: add barriers for Loongson

Somehow these LL/SC usages are not taken care of, breaking Loongson
builds. Add the SYNCs appropriately.

Signed-off-by: Wang Xuerui <git@xen0n.name>
Signed-off-by: Paul Burton <paulburton@kernel.org>
Cc: linux-mips@vger.kernel.org
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Jiaxun Yang <jiaxun.yang@flygoat.com>
Cc: <stable@vger.kernel.org> # v5.5+

authored by

Wang Xuerui and committed by
Paul Burton
3e86460e c9444384

+4
+4
arch/mips/include/asm/local.h
··· 37 37 __asm__ __volatile__( 38 38 " .set push \n" 39 39 " .set arch=r4000 \n" 40 + __SYNC(full, loongson3_war) " \n" 40 41 "1:" __LL "%1, %2 # local_add_return \n" 41 42 " addu %0, %1, %3 \n" 42 43 __SC "%0, %2 \n" ··· 53 52 __asm__ __volatile__( 54 53 " .set push \n" 55 54 " .set "MIPS_ISA_ARCH_LEVEL" \n" 55 + __SYNC(full, loongson3_war) " \n" 56 56 "1:" __LL "%1, %2 # local_add_return \n" 57 57 " addu %0, %1, %3 \n" 58 58 __SC "%0, %2 \n" ··· 86 84 __asm__ __volatile__( 87 85 " .set push \n" 88 86 " .set arch=r4000 \n" 87 + __SYNC(full, loongson3_war) " \n" 89 88 "1:" __LL "%1, %2 # local_sub_return \n" 90 89 " subu %0, %1, %3 \n" 91 90 __SC "%0, %2 \n" ··· 102 99 __asm__ __volatile__( 103 100 " .set push \n" 104 101 " .set "MIPS_ISA_ARCH_LEVEL" \n" 102 + __SYNC(full, loongson3_war) " \n" 105 103 "1:" __LL "%1, %2 # local_sub_return \n" 106 104 " subu %0, %1, %3 \n" 107 105 __SC "%0, %2 \n"