Browse Source

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 <peterz@infradead.org>
Signed-off-by: David Howells <dhowells@redhat.com>
David Howells 14 years ago
parent
commit
af79420654
1 changed files with 1 additions and 1 deletions
  1. 1 1
      arch/mn10300/include/asm/atomic.h

+ 1 - 1
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
  * Atomically reads the value of @v.  Note that the guaranteed
  * useful range of an atomic_t is only 24 bits.
  * 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
  * atomic_set - set atomic variable