Thread (1 message) 1 message, 1 author, 2009-08-18

Re: [PATCH] qe_lib: Set gpio data before changing the direction to output

From: Michael Barkowski <hidden>
Date: 2009-08-18 21:23:35

Timur Tabi wrote:
Michael Barkowski wrote:
quoted
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index 3485288..e7bf136 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -107,12 +107,11 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
 
 	spin_lock_irqsave(&qe_gc->lock, flags);
 
+	qe_gpio_set(gc, gpio, val);
qe_gpio_set already calls spin_lock_irqsave(), so you'll have nested spinlocks, which will lock up on SMP.

Let me guess, you didn't test this on a dual-core system?
That is correct.  See v2 and please test, YMMV, etc

-- 
Michael Barkowski
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help