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

Commit 0286237c authored by Rohit Vaswani's avatar Rohit Vaswani
Browse files

ARM64: spinlock: Move the dsb+sev after the stlxr has succeeded



In arch_read_unlock, the earlier commit
88a06607 had added the DSB+SEV
before checking if the stlxr has successfully completed.
Move the DSB + SEV after the compare instruction to prevent
unnecessary SEVs.

Change-Id: I58bdad4db333a2acc31bcdc0e911c493cd3417bd
Signed-off-by: default avatarRohit Vaswani <rvaswani@codeaurora.org>
parent 6a8a77bd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -206,11 +206,11 @@ static inline void arch_read_unlock(arch_rwlock_t *rw)
	"1:	ldxr	%w0, %2\n"
	"	sub	%w0, %w0, #1\n"
	"	stlxr	%w1, %w0, %2\n"
	"	cbnz	%w1, 1b\n"
#ifdef CONFIG_ARM64_SEV_IN_LOCK_UNLOCK
	"	dsb sy\n"
	"	sev\n"
#endif
	"	cbnz	%w1, 1b\n"
	: "=&r" (tmp), "=&r" (tmp2), "+Q" (rw->lock)
	:
	: "memory");