From: David Howells Date: Mon, 14 Mar 2011 14:49:44 +0000 (+0000) Subject: MN10300: atomic_read() should ensure it emits a load X-Git-Tag: firefly_0821_release~7613^2~2251^2 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=af794206542e03d62138a107ee0ffb5e7d631881;p=firefly-linux-kernel-4.4.55.git MN10300: atomic_read() should ensure it emits a load atomic_read() needs to ensure that it emits a load (which it can do by using ACCESS_ONCE()). Reported-by: Peter Zijlstra Signed-off-by: David Howells --- diff --git a/arch/mn10300/include/asm/atomic.h b/arch/mn10300/include/asm/atomic.h index 92d2f9298e38..9d773a639513 100644 --- a/arch/mn10300/include/asm/atomic.h +++ b/arch/mn10300/include/asm/atomic.h @@ -139,7 +139,7 @@ static inline unsigned long __cmpxchg(volatile unsigned long *m, * Atomically reads the value of @v. Note that the guaranteed * useful range of an atomic_t is only 24 bits. */ -#define atomic_read(v) ((v)->counter) +#define atomic_read(v) (ACCESS_ONCE((v)->counter)) /** * atomic_set - set atomic variable