From: Anton Vorontsov <avorontsov@ru.mvista.com>
To: Michael Barkowski <michaelbarkowski@ruggedcom.com>
Cc: linuxppc-dev@ozlabs.org, Timur Tabi <timur@freescale.com>
Subject: Re: [PATCH v2] qe_lib: Set gpio data before changing the direction to output
Date: Wed, 19 Aug 2009 01:33:55 +0400 [thread overview]
Message-ID: <20090818213355.GA20966@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <4A8B1B2C.5090606@ruggedcom.com>
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 <michaelbarkowski@ruggedcom.com>
Acked-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Thanks!
> ---
> Anton Vorontsov wrote:
> > 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
next prev parent reply other threads:[~2009-08-18 21:33 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-18 20:59 [PATCH] qe_lib: Set gpio data before changing the direction to output Michael Barkowski
[not found] ` <20090818210805.GA1725@oksana.dev.rtsoft.ru>
2009-08-18 21:20 ` [PATCH v2] " Michael Barkowski
2009-08-18 21:33 ` Anton Vorontsov [this message]
2009-08-18 22:33 ` Timur Tabi
2009-08-18 22:56 ` Anton Vorontsov
2009-08-19 13:30 ` Michael Barkowski
2009-08-19 13:32 ` Anton Vorontsov
2009-08-25 14:44 ` Kumar Gala
[not found] ` <4A8B183D.2030202@freescale.com>
2009-08-18 21:23 ` [PATCH] " Michael Barkowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090818213355.GA20966@oksana.dev.rtsoft.ru \
--to=avorontsov@ru.mvista.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=michaelbarkowski@ruggedcom.com \
--cc=timur@freescale.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).