]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 20:41:08 +0000 (13:41 -0700)
commit4e43bbd4ab386a70bca84000943254f6ccefce77
tree546be6ea10cccaed4d173ccf43be9ee6788c890b
parent2dd10ce8d0fe59b7171f1709c2592ef70d5f4a1f
powerpc: Add smp_mb()s to arch_spin_unlock_wait()

commit 78e05b1421fa41ae8457701140933baa5e7d9479 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/lib/locks.c