lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAAVeFuKT1OPhM8LMQ5z9WejZEeYgqSzwcmCOw6V7E7Y0c=8btA@mail.gmail.com>
Date:	Thu, 19 Mar 2015 11:07:16 +0900
From:	Alexandre Courbot <gnurou@...il.com>
To:	David Cohen <david.a.cohen@...ux.intel.com>
Cc:	Linus Walleij <linus.walleij@...aro.org>,
	"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [RFC] gpio: add set_active_low() function to gpio_chip

On Thu, Mar 19, 2015 at 5:16 AM, David Cohen
<david.a.cohen@...ux.intel.com> wrote:
> Some gpio controllers are capable of programming its pins' active-low
> state. Let's add this new gpio_chip function for such cases and use it
> in gpiolib.
>
> When set_active_low() is implemented, we no longer need to do soft flips
> on values from non-raw get functions.
>
> Signed-off-by: David Cohen <david.a.cohen@...ux.intel.com>
> ---
>
> Hi,
>
> This is a RFC, not meant for integration (yet).
>
> We have a GPIO controller that is capable of inverting the GPIO logical value
> on hardware using a register (and GPIO voltage level if configured for output):
> - If GPIO pin is configured for input, only the logical value is affected: the
>   GPIO level stays the same but the read values are inverted (it affects even
>   interrupt event triggers).
> - If GPIO pin is configured for output, the GPIO level is also inverted.
>
> Is it acceptable to expose this functionality via new gpio chip operation
> set_active_low()?

At first I thought "why not", but then I couldn't help but ask "why?"

Handling the active low state in software is basically free and
requires no extra support. What is the benefit of handling it in
hardware that would counterbalance the complexity this adds to the
GPIO framework?

Also, wouldn't that require us to reverse this active-low logic in the
*_raw functions for them to work as expected?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ