tile: use READ_ONCE() in arch_spin_is_locked()
authorChris Metcalf <cmetcalf@ezchip.com>
Tue, 28 Apr 2015 17:00:42 +0000 (13:00 -0400)
committerChris Metcalf <cmetcalf@ezchip.com>
Wed, 29 Apr 2015 02:43:16 +0000 (22:43 -0400)
commit627ae54854edfbf29d5997015c190de22eef497f
treeefa812a770bc06ce188f77262b5916e171ceaca1
parent14c3dec2a875d898262be79c0f85e5f2b70a71b0
tile: use READ_ONCE() in arch_spin_is_locked()

This avoid potential issues if callers were to loop on these
routines without some kind of memory barrier.  Currently there
are no such users in-tree, but it seems better safe than sorry.

Also, in the tilepro case we read "current" before "next",
which gives us a slightly better guarantee that the lock was
actually unlocked at least momentarily if we return claiming
that it is not locked.  None of the callers actually rely on
this behavior, as far as I know, however.

Signed-off-by: Chris Metcalf <cmetcalf@ezchip.com>
arch/tile/include/asm/spinlock_32.h
arch/tile/include/asm/spinlock_64.h