Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a6b7186 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "arm64: rwlocks: retry trylock operation if strex fails on free lock"

parents eadfd0c8 ce20aa6a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -140,9 +140,10 @@ static inline int arch_write_trylock(arch_rwlock_t *rw)
	unsigned int tmp;

	asm volatile(
	"	ldaxr	%w0, %1\n"
	"2:	ldaxr	%w0, %1\n"
	"	cbnz	%w0, 1f\n"
	"	stxr	%w0, %w2, %1\n"
	"	cbnz	%w0, 2b\n"
	"1:\n"
	: "=&r" (tmp), "+Q" (rw->lock)
	: "r" (0x80000000)
@@ -209,10 +210,11 @@ static inline int arch_read_trylock(arch_rwlock_t *rw)
	unsigned int tmp, tmp2 = 1;

	asm volatile(
	"	ldaxr	%w0, %2\n"
	"2:	ldaxr	%w0, %2\n"
	"	add	%w0, %w0, #1\n"
	"	tbnz	%w0, #31, 1f\n"
	"	stxr	%w1, %w0, %2\n"
	"	cbnz	%w1, 2b\n"
	"1:\n"
	: "=&r" (tmp), "+r" (tmp2), "+Q" (rw->lock)
	: