ARM: 7749/1: spinlock: retry trylock operation if strex fails on free lock
authorWill Deacon <will.deacon@arm.com>
Wed, 5 Jun 2013 10:27:26 +0000 (11:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 7 Mar 2014 05:30:13 +0000 (21:30 -0800)
commitf411a4439b68149518898379d7d537a32becb381
treefd18a509b56ea9c40e1655956757492c6b017126
parent79e43826099dad17a9ff6014b508f2de950099f6
ARM: 7749/1: spinlock: retry trylock operation if strex fails on free lock

commit 15e7e5c1ebf556cd620c9b091e121091ac760f6d upstream.

An exclusive store instruction may fail for reasons other than lock
contention (e.g. a cache eviction during the critical section) so, in
line with other architectures using similar exclusive instructions
(alpha, mips, powerpc), retry the trylock operation if the lock appears
to be free but the strex reported failure.

Reported-by: Tony Thompson <anthony.thompson@arm.com>
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: Li Zefan <lizefan@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/spinlock.h