]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
arm64: spinlocks: implement smp_mb__before_spinlock() as smp_mb()
authorWill Deacon <will.deacon@arm.com>
Mon, 5 Sep 2016 10:56:05 +0000 (11:56 +0100)
committerJiri Slaby <jslaby@suse.cz>
Thu, 29 Sep 2016 09:14:26 +0000 (11:14 +0200)
commite5eb7be2db286ec3fdaf5cf5451e653d6a6d95b8
treea0430a15a55ce9a3091dd48f1ce42ca8742d7c0d
parentf23a0f229e0f46d823234a8e6b761445ef08a2a3
arm64: spinlocks: implement smp_mb__before_spinlock() as smp_mb()

commit 872c63fbf9e153146b07f0cece4da0d70b283eeb upstream.

smp_mb__before_spinlock() is intended to upgrade a spin_lock() operation
to a full barrier, such that prior stores are ordered with respect to
loads and stores occuring inside the critical section.

Unfortunately, the core code defines the barrier as smp_wmb(), which
is insufficient to provide the required ordering guarantees when used in
conjunction with our load-acquire-based spinlock implementation.

This patch overrides the arm64 definition of smp_mb__before_spinlock()
to map to a full smp_mb().

Cc: Peter Zijlstra <peterz@infradead.org>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
arch/arm64/include/asm/spinlock.h