msm: remote_spinlock: implement sfpb trylock
The trylock API for sfpb remote spinlock implementation is stubbed out.
This is a problem as "msm: smd: Add remote spinlock init check" adds a
usecase for the trylock API provided by remote_spinlock. Implement the
sfpb trylock so that the usecase remains functionally correct on targets
using sfpb remote spinlocks.
Change-Id: Ic6a05b42cc944e5613deb68b750a46abf75dfd29
Signed-off-by: Jeffrey Hugo <jhugo@codeaurora.org>
diff --git a/arch/arm/mach-msm/remote_spinlock.c b/arch/arm/mach-msm/remote_spinlock.c
index 4e09a9e..27789c9 100644
--- a/arch/arm/mach-msm/remote_spinlock.c
+++ b/arch/arm/mach-msm/remote_spinlock.c
@@ -341,7 +341,9 @@
static int __raw_remote_sfpb_spin_trylock(raw_remote_spinlock_t *lock)
{
- return 1;
+ writel_relaxed(SPINLOCK_PID_APPS, lock);
+ smp_mb();
+ return readl_relaxed(lock) == SPINLOCK_PID_APPS;
}
static void __raw_remote_sfpb_spin_unlock(raw_remote_spinlock_t *lock)