All of lore.kernel.org
 help / color / mirror / Atom feed
From: viresh.kumar@st.com (Viresh KUMAR)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] PL061 GPIO: Changing *_irq_chip_data with *_irq_data for real irqs.
Date: Wed, 21 Apr 2010 13:42:06 +0530	[thread overview]
Message-ID: <4BCEB356.1010708@st.com> (raw)
In-Reply-To: <20100421080242.GB6345@jasper.tkos.co.il>

On 4/21/2010 1:32 PM, Baruch Siach wrote:
>>>> > >> diff --git a/drivers/gpio/pl061.c b/drivers/gpio/pl061.c
>>>> > >> index 3ad1eeb..0a30124 100644
>>>> > >> --- a/drivers/gpio/pl061.c
>>>> > >> +++ b/drivers/gpio/pl061.c
>>>> > >> @@ -86,10 +86,10 @@ static int pl061_direction_output(struct gpio_chip *gc, unsigned offset,
>>>> > >>  		return -EINVAL;
>>>> > >>  
>>>> > >>  	spin_lock_irqsave(&chip->lock, flags);
>>>> > >> -	writeb(!!value << offset, chip->base + (1 << (offset + 2)));
>>> > > 
>>> > > I'm still for keeping this line.
>> > 
>> > I will do that, but i am still not sure why should we keep it.
>> > Changing value before changing direction will have no effect.
>> > And if in future releases of pl061 IP, this bug is resolved then also the
>> > changing value after direction will be fine.
> Wrong. Changing the value after direction may cause the GPIO line to output 
> the wrong value for a short period of time (between the first writeb() and the 
> second). Preventing this is the whole point of having the value parameter in 
> the .direction_output method, instead of calling gpio_direction_output() and 
> then gpio_set_value().

Thanks for clarifying.

regards,
viresh.

      reply	other threads:[~2010-04-21  8:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-21  7:00 [PATCH] PL061 GPIO: Changing *_irq_chip_data with *_irq_data for real irqs Viresh KUMAR
2010-04-21  7:37 ` Baruch Siach
2010-04-21  7:44   ` Viresh KUMAR
2010-04-21  8:02     ` Baruch Siach
2010-04-21  8:12       ` Viresh KUMAR [this message]

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=4BCEB356.1010708@st.com \
    --to=viresh.kumar@st.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.