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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50867A2B.5020606@linux.intel.com>
Date:	Tue, 23 Oct 2012 14:06:19 +0300
From:	Mathias Nyman <mathias.nyman@...ux.intel.com>
To:	Linus Walleij <linus.walleij@...aro.org>
CC:	linus.walleij@...ricsson.com, grant.likely@...retlab.ca,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH] gpiolib: add gpio get direction support

On 10/23/2012 01:23 AM, Linus Walleij wrote:
> On Mon, Oct 22, 2012 at 3:44 PM, Mathias Nyman
> <mathias.nyman@...ux.intel.com>  wrote:
>
>> If the .get_direction callback is set, then gpiolib will use it
>> for showing correct gpio direction in sysfs and debug. If not set
>> then it will work the old way; e.g. guessing everything is input
>> until direction is set.
>
> If the driver cannot report the direction setting you *could*
> cache the result of all calls to gpio_direction_output()
> and gpio_direction_input() somewhere. But I don't know
> if it's a good idea.
>
> Anyway, if the callback is only called internally in the GPIOlib
> why are you making the function public to the entire
> kernel

Thought I'd do it the same was as gpio_direction_output() and 
gpio_direction_input(), but if there is no need for getting the 
direction outside gpiolob then it can be skipped. Main motivation was to 
get correct direction values in debug and sysfs after boot.

gpiolib currently uses cached values of gpio_direction_output/input() in 
sysfs. If the .get_direction callback exists it is used to refresh the 
cached values.

I'll write a new patch without the public gpio_get_direction().

-Mathias
--
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