arm64: cmpwait: Clear event register before arming exclusive monitor
authorWill Deacon <will.deacon@arm.com>
Mon, 30 Apr 2018 12:56:32 +0000 (13:56 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 3 Aug 2018 05:50:33 +0000 (07:50 +0200)
commit6a43d5a3ca6c03103e614ac7d075615ef6609731
tree26d2f2f9bc0890b10a8a2fab09657fc04be116e9
parent62a87c8759f272e65f7f60f4f7d2d7b3671e1edc
arm64: cmpwait: Clear event register before arming exclusive monitor

[ Upstream commit 1cfc63b5ae60fe7e01773f38132f98d8b13a99a0 ]

When waiting for a cacheline to change state in cmpwait, we may immediately
wake-up the first time around the outer loop if the event register was
already set (for example, because of the event stream).

Avoid these spurious wakeups by explicitly clearing the event register
before loading the cacheline and setting the exclusive monitor.

Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm64/include/asm/cmpxchg.h