From: Will Deacon Date: Fri, 2 May 2014 15:24:12 +0000 (+0100) Subject: arm64: barriers: use barrier() instead of smp_mb() when !SMP X-Git-Tag: firefly_0821_release~3680^2~36^2~14^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=b817da4cf03a33c8c40e3bef04d3f3ed64277d47;p=firefly-linux-kernel-4.4.55.git arm64: barriers: use barrier() instead of smp_mb() when !SMP The recently introduced acquire/release accessors refer to smp_mb() in the !CONFIG_SMP case. This is confusing when reading the code, so use barrier() directly when we know we're UP. Acked-by: Catalin Marinas Signed-off-by: Will Deacon Signed-off-by: Catalin Marinas (cherry picked from commit be6209a6107e0f63544e3e7d00fd5c95434ec80a) Signed-off-by: Mark Brown Conflicts: arch/arm64/include/asm/barrier.h --- diff --git a/arch/arm64/include/asm/barrier.h b/arch/arm64/include/asm/barrier.h index 9a4c3d5b402e..709f1f6d6bbd 100644 --- a/arch/arm64/include/asm/barrier.h +++ b/arch/arm64/include/asm/barrier.h @@ -36,6 +36,22 @@ #define smp_mb() barrier() #define smp_rmb() barrier() #define smp_wmb() barrier() + +#define smp_store_release(p, v) \ +do { \ + compiletime_assert_atomic_type(*p); \ + barrier(); \ + ACCESS_ONCE(*p) = (v); \ +} while (0) + +#define smp_load_acquire(p) \ +({ \ + typeof(*p) ___p1 = ACCESS_ONCE(*p); \ + compiletime_assert_atomic_type(*p); \ + barrier(); \ + ___p1; \ +}) + #else #define smp_mb() dmb(ish)