[PATCH 1/2] powerpc: Add smp_mb() to arch_spin_is_locked()

2014-09-10 Thread Michael Ellerman
Backported from 51d7d5205d33 upstream, for stable 3.14 and 3.16. The kernel defines the function spin_is_locked(), which can be used to check if a spinlock is currently locked. Using spin_is_locked() on a lock you don't hold is obviously racy. That is, even though you may observe that the lock is

[PATCH 1/2] powerpc: Add smp_mb() to arch_spin_is_locked()

2014-08-06 Thread Michael Ellerman
The kernel defines the function spin_is_locked(), which can be used to check if a spinlock is currently locked. Using spin_is_locked() on a lock you don't hold is obviously racy. That is, even though you may observe that the lock is unlocked, it may become locked at any time. There is (at least)