From: Jean Delvare <khali@linux-fr.org>
To: Peter Tyser <ptyser@xes-inc.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Grant Likely <grant.likely@secretlab.ca>,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH 1/2] gpio-ich: Check for pin availability at request time
Date: Tue, 5 Mar 2013 20:40:15 +0100 [thread overview]
Message-ID: <20130305204015.36639af6@endymion.delvare> (raw)
In-Reply-To: <1362507414.28106.62.camel@petert>
Hi Peter,
On Tue, 05 Mar 2013 12:16:54 -0600, Peter Tyser wrote:
> On Tue, 2013-03-05 at 09:06 +0100, Jean Delvare wrote:
> > Stop checking for pin availability in get functions. These functions
> > can be called repeatedly, so checking every time is bad for
> > performance.
> >
> > Instead, check at pin request time. This only happens once, and we can
> > let the caller know of the unavailability much earlier.
>
> Is there a reason to not remove the ichx_gpio_check_available() calls
> from the ichx_gpio_direction_output() and ichx_gpio_direction_input()
> functions in this change?
No valid reason other than me being a chicken ;)
I seemed to remember that requesting GPIOs was optional so I didn't
want to remove too many checks. However...
> I had originally assumed these checks were to support the "legacy"
> interface where users could use the GPIOs without first requesting the
> GPIO, but after looking a bit further it looks like the gpiolib code to
> set a GPIO as an input or output does auto-request the GPIO before
> setting its direction. So I'd assume your 1 check in
> ichx_gpio_request() would cover the "legacy" interface too.
... you are implying that this memory of mine refers to ancient times
and this is no longer true. Apparently the change happened in April
2009, not sure how I managed to miss that for so long.
Given that, I completely agree that the check can go away from
ichx_gpio_direction_output() and ichx_gpio_direction_input() as well.
The performance gain won't be as important as for ichx_gpio_get*() but
it's free so let's take it.
Thanks a lot for the review, I'll send v2 of this patch.
--
Jean Delvare
prev parent reply other threads:[~2013-03-05 19:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-05 8:06 Jean Delvare
2013-03-05 18:16 ` Peter Tyser
2013-03-05 19:40 ` Jean Delvare [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=20130305204015.36639af6@endymion.delvare \
--to=khali@linux-fr.org \
--cc=grant.likely@secretlab.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ptyser@xes-inc.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
all inboxes | Powered by JetHome®