From cd9bf944a5a45a22f5cf39e3086c992ea7626ebc Mon Sep 17 00:00:00 2001 From: Trusted Logic Date: Fri, 23 Sep 2011 13:14:00 -0700 Subject: OMAP4: SMC: Correct a spinlock during rpc_execute Change-Id: Ia87a536468a57256fb24de60e3782142825bd6aa Signed-off-by: Gonzalo Alexandre Signed-off-by: Trusted Logic Signed-off-by: Bryan Buckley --- security/smc/tf_comm_mshield.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'security') diff --git a/security/smc/tf_comm_mshield.c b/security/smc/tf_comm_mshield.c index b148e6c..c36473e 100644 --- a/security/smc/tf_comm_mshield.c +++ b/security/smc/tf_comm_mshield.c @@ -471,9 +471,11 @@ int tf_rpc_execute(struct tf_comm *comm) * L4 SEC Clock domain handling *-------------------------------------------------------------------------- */ +static DEFINE_SPINLOCK(clk_lock); void tf_l4sec_clkdm_wakeup(bool wakelock) { - spin_lock(&tf_get_device()->sm.lock); + unsigned long flags; + spin_lock_irqsave(&clk_lock, flags); #ifdef CONFIG_HAS_WAKELOCK if (wakelock) { tf_wake_lock_count++; @@ -482,7 +484,7 @@ void tf_l4sec_clkdm_wakeup(bool wakelock) #endif smc_l4_sec_clkdm_use_count++; clkdm_wakeup(smc_l4_sec_clkdm); - spin_unlock(&tf_get_device()->sm.lock); + spin_unlock_irqrestore(&clk_lock, flags); } void tf_l4sec_clkdm_allow_idle(bool wakeunlock) @@ -499,7 +501,7 @@ void tf_l4sec_clkdm_allow_idle(bool wakeunlock) wake_unlock(&g_tf_wake_lock); } #endif - spin_unlock(&tf_get_device()->sm.lock); + spin_unlock_irqrestore(&clk_lock, flags); } /*-------------------------------------------------------------------------- -- cgit v1.1