From: Linus Walleij <linus.walleij@linaro.org>
To: David Cohen <david.a.cohen@linux.intel.com>
Cc: Alexandre Courbot <gnurou@gmail.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [RFC] gpio: add set_active_low() function to gpio_chip
Date: Fri, 27 Mar 2015 09:45:58 +0100 [thread overview]
Message-ID: <CACRpkdZDA9Tz3rk++3iJWfLvWCXFiJSMLtG4PpfcV1aB0SXscA@mail.gmail.com> (raw)
In-Reply-To: <1426709782-2763-1-git-send-email-david.a.cohen@linux.intel.com>
On Wed, Mar 18, 2015 at 9:16 PM, David Cohen
<david.a.cohen@linux.intel.com> wrote:
> +++ b/drivers/gpio/gpiolib-sysfs.c
> @@ -289,11 +289,15 @@ static DEVICE_ATTR(edge, 0644, gpio_edge_show, gpio_edge_store);
> static int sysfs_set_active_low(struct gpio_desc *desc, struct device *dev,
> int value)
> {
> + struct gpio_chip *chip = desc->chip;
> int status = 0;
>
> if (!!test_bit(FLAG_ACTIVE_LOW, &desc->flags) == !!value)
> return 0;
>
> + if (chip->set_active_low)
> + chip->set_active_low(chip, gpio_chip_hwgpio(desc), value);
> +
> if (value)
> set_bit(FLAG_ACTIVE_LOW, &desc->flags);
Since the only user seems to be this abominable sysfs, and since that is
definitely not on the hotpath due to context switching, this cannot possibly
gain any performance benefits.
Unless we can come up with a use case where this actually improves
performance we should just let software handle this instead.
I like to have all hardware features implemented usually, so I'm a bit
torn. But this one lacks a plausible use case. It looks like some hardware
engineers attempt to be helpful to software developers.
Any takers?
Yours,
Linus Walleij
prev parent reply other threads:[~2015-03-27 8:46 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-18 20:16 [RFC] gpio: add set_active_low() function to gpio_chip David Cohen
2015-03-19 2:07 ` Alexandre Courbot
2015-03-19 15:33 ` Stephen Warren
2015-03-27 8:45 ` Linus Walleij [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=CACRpkdZDA9Tz3rk++3iJWfLvWCXFiJSMLtG4PpfcV1aB0SXscA@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=david.a.cohen@linux.intel.com \
--cc=gnurou@gmail.com \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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 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).