summaryrefslogtreecommitdiffstats
path: root/lib/lockref.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2019-06-18 19:12:47 +0100
committerMark Brown <broonie@kernel.org>2019-06-18 19:12:47 +0100
commite1d700f7c94e755106749411706a38e39a93404b (patch)
treeb1230cb7eba5a4ef28ed2cd2527d9ac78f06cc00 /lib/lockref.c
parentba576a6232dc06605f4edfaeea9b526ba7724f84 (diff)
parentd1fdb6d8f6a4109a4263176c84b899076a5f8008 (diff)
downloadtalos-op-linux-e1d700f7c94e755106749411706a38e39a93404b.tar.gz
talos-op-linux-e1d700f7c94e755106749411706a38e39a93404b.zip
Merge tag 'v5.2-rc4' into regulator-5.3
Linux 5.2-rc4
Diffstat (limited to 'lib/lockref.c')
-rw-r--r--lib/lockref.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/lockref.c b/lib/lockref.c
index 3d468b53d4c9..5b34bbd3eba8 100644
--- a/lib/lockref.c
+++ b/lib/lockref.c
@@ -9,6 +9,7 @@
* failure case.
*/
#define CMPXCHG_LOOP(CODE, SUCCESS) do { \
+ int retry = 100; \
struct lockref old; \
BUILD_BUG_ON(sizeof(old) != 8); \
old.lock_count = READ_ONCE(lockref->lock_count); \
@@ -21,6 +22,8 @@
if (likely(old.lock_count == prev.lock_count)) { \
SUCCESS; \
} \
+ if (!--retry) \
+ break; \
cpu_relax(); \
} \
} while (0)
OpenPOWER on IntegriCloud