Thread (7 messages) 7 messages, 4 authors, 2009-08-25

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

From: Anton Vorontsov <hidden>
Date: 2009-08-18 21:33:59

On Tue, Aug 18, 2009 at 05:20:44PM -0400, Michael Barkowski wrote:
This avoids having a short glitch if the desired initial value is not
the same as what was previously in the data register.

Signed-off-by: Michael Barkowski <redacted>
Acked-by: Anton Vorontsov <redacted>

Thanks!
quoted hunk ↗ jump to hunk
---
Anton Vorontsov wrote:
quoted
There is a recursive locking bug: _set() takes the same spinlock.
So you'd better move this call two lines upper. Otherwise the
patch looks OK.

Thanks!
Thanks - here is v2.

 arch/powerpc/sysdev/qe_lib/gpio.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/powerpc/sysdev/qe_lib/gpio.c b/arch/powerpc/sysdev/qe_lib/gpio.c
index 3485288..8e7a776 100644
--- a/arch/powerpc/sysdev/qe_lib/gpio.c
+++ b/arch/powerpc/sysdev/qe_lib/gpio.c
@@ -105,14 +105,14 @@ static int qe_gpio_dir_out(struct gpio_chip *gc, unsigned int gpio, int val)
 	struct qe_gpio_chip *qe_gc = to_qe_gpio_chip(mm_gc);
 	unsigned long flags;
 
+	qe_gpio_set(gc, gpio, val);
+
 	spin_lock_irqsave(&qe_gc->lock, flags);
 
 	__par_io_config_pin(mm_gc->regs, gpio, QE_PIO_DIR_OUT, 0, 0, 0);
 
 	spin_unlock_irqrestore(&qe_gc->lock, flags);
 
-	qe_gpio_set(gc, gpio, val);
-
 	return 0;
 }
 
-- 
1.6.3.3
-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help