]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: Add smp_mb()s to arch_spin_unlock_wait()
authorMichael Ellerman <mpe@ellerman.id.au>
Thu, 7 Aug 2014 05:36:18 +0000 (15:36 +1000)
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>
Wed, 13 Aug 2014 05:13:27 +0000 (15:13 +1000)
commitccc6d8b9e8d66e40539cfbe2f63fe63abd03eed1
treeddd3d45946163cdc5f5836d2e460b9b4f4dd24c2
parent56472647416edc920a72a2c5a73dc87f6733a96d
powerpc: Add smp_mb()s to arch_spin_unlock_wait()

Similar to the previous commit which described why we need to add a
barrier to arch_spin_is_locked(), we have a similar problem with
spin_unlock_wait().

We need a barrier on entry to ensure any spinlock we have previously
taken is visibly locked prior to the load of lock->slock.

It's also not clear if spin_unlock_wait() is intended to have ACQUIRE
semantics. For now be conservative and add a barrier on exit to give it
ACQUIRE semantics.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
arch/powerpc/lib/locks.c