linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: SAMSUNG: Bug fix spin_lock recursion in clk_enable() and clk_disable()
@ 2010-10-12  0:39 Jaecheol Lee
  2010-10-18 23:09 ` Ben Dooks
  0 siblings, 1 reply; 6+ messages in thread
From: Jaecheol Lee @ 2010-10-12  0:39 UTC (permalink / raw)
  To: linux-arm-kernel

From: Minho Ban <mhban@samsung.com>

The clk_enable() and clk_disable() can be used process and ISR either.
So spin_lock_irqsave should be used instead.

Signed-off-by: Minho Ban <mhban@samsung.com>
Signed-off-by: Jaecheol Lee <jc.lee@samsung.com>
---
 arch/arm/plat-samsung/clock.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/arch/arm/plat-samsung/clock.c b/arch/arm/plat-samsung/clock.c
index e8d20b0..2a991a5 100644
--- a/arch/arm/plat-samsung/clock.c
+++ b/arch/arm/plat-samsung/clock.c
@@ -138,31 +138,35 @@ void clk_put(struct clk *clk)
 
 int clk_enable(struct clk *clk)
 {
+	unsigned long flags;
+
 	if (IS_ERR(clk) || clk == NULL)
 		return -EINVAL;
 
 	clk_enable(clk->parent);
 
-	spin_lock(&clocks_lock);
+	spin_lock_irqsave(&clocks_lock, flags);
 
 	if ((clk->usage++) == 0)
 		(clk->enable)(clk, 1);
 
-	spin_unlock(&clocks_lock);
+	spin_unlock_irqrestore(&clocks_lock, flags);
 	return 0;
 }
 
 void clk_disable(struct clk *clk)
 {
+	unsigned long flags;
+
 	if (IS_ERR(clk) || clk == NULL)
 		return;
 
-	spin_lock(&clocks_lock);
+	spin_lock_irqsave(&clocks_lock, flags);
 
 	if ((--clk->usage) == 0)
 		(clk->enable)(clk, 0);
 
-	spin_unlock(&clocks_lock);
+	spin_unlock_irqrestore(&clocks_lock, flags);
 	clk_disable(clk->parent);
 }
 
-- 
1.6.2.5

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-21 22:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-12  0:39 [PATCH] ARM: SAMSUNG: Bug fix spin_lock recursion in clk_enable() and clk_disable() Jaecheol Lee
2010-10-18 23:09 ` Ben Dooks
2010-10-19  1:12   ` Jassi Brar
2010-10-19  2:55     ` mhban
2010-10-19 18:57   ` Russell King - ARM Linux
2010-10-21 22:39     ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).