diff options
| author | Peter Zijlstra <peterz@infradead.org> | 2015-09-18 05:13:10 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2015-09-23 03:54:28 -0400 |
| commit | 62e8a3258bda118f24ff462fe04cfbe75b8189b5 (patch) | |
| tree | 79edd4b96f8c3495435be8b148127d5738d1db63 /arch/hexagon/include/asm | |
| parent | 90fe65148ea76988d8d5acbf3e578aa74129a490 (diff) | |
atomic, arch: Audit atomic_{read,set}()
This patch makes sure that atomic_{read,set}() are at least
{READ,WRITE}_ONCE().
We already had the 'requirement' that atomic_read() should use
ACCESS_ONCE(), and most archs had this, but a few were lacking.
All are now converted to use READ_ONCE().
And, by a symmetry and general paranoia argument, upgrade atomic_set()
to use WRITE_ONCE().
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Dmitry Vyukov <dvyukov@google.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: james.hogan@imgtec.com
Cc: linux-kernel@vger.kernel.org
Cc: oleg@redhat.com
Cc: will.deacon@arm.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/hexagon/include/asm')
| -rw-r--r-- | arch/hexagon/include/asm/atomic.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/hexagon/include/asm/atomic.h b/arch/hexagon/include/asm/atomic.h index 811d61f6422d..55696c4100d4 100644 --- a/arch/hexagon/include/asm/atomic.h +++ b/arch/hexagon/include/asm/atomic.h | |||
| @@ -48,7 +48,7 @@ static inline void atomic_set(atomic_t *v, int new) | |||
| 48 | * | 48 | * |
| 49 | * Assumes all word reads on our architecture are atomic. | 49 | * Assumes all word reads on our architecture are atomic. |
| 50 | */ | 50 | */ |
| 51 | #define atomic_read(v) ((v)->counter) | 51 | #define atomic_read(v) READ_ONCE((v)->counter) |
| 52 | 52 | ||
| 53 | /** | 53 | /** |
| 54 | * atomic_xchg - atomic | 54 | * atomic_xchg - atomic |
