]> 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>
Tue, 14 Oct 2014 01:07:56 +0000 (12:07 +1100)
committerJiri Slaby <jslaby@suse.cz>
Fri, 31 Oct 2014 14:11:33 +0000 (15:11 +0100)
commitd9fc4e657d6fe0886a2a960eb09102c27a7babfd
treeb5f3f67efd956106ec2e6867de2b240bcb104cc0
parent5aaee42d255a81d3b010432265254353946d88b3
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>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/powerpc/lib/locks.c