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]
Date:	Mon, 21 Feb 2011 10:37:18 +0100
From:	Alexander Stein <alexander.stein@...tec-electronic.com>
To:	Wolfram Sang <w.sang@...gutronix.de>
Cc:	"Lars-Peter Clausen" <lars@...afoo.de>,
	Eric Miao <eric.y.miao@...il.com>,
	Peter Tyser <ptyser@...-inc.com>, linux-kernel@...r.kernel.org,
	Alek Du <alek.du@...el.com>,
	Samuel Ortiz <sameo@...ux.intel.com>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	"Uwe Kleine-K?nig" <u.kleine-koenig@...gutronix.de>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	Joe Perches <joe@...ches.com>,
	Alan Cox <alan@...rguk.ukuu.org.uk>,
	Grant Likely <grant.likely@...retlab.ca>
Subject: Re: [PATCH v2 1/4] gpiolib: Add "unknown" direction support

On Monday 21 February 2011, 10:19:16 Wolfram Sang wrote:
> > > Sharing GPIOs in read-only mode, is indeed something that is not
> > > covered by the GPIO API. It might be worth adding a
> > > gpio_request_shared, which would only permit setting the direction to
> > > input. Futher gpio_request_shared calls would be allowed but
> > > gpio_request calls would fail.
> > 
> > gpio_request_shared sounds interesting, but in this case an implicit
> 
> Can you name a use-case? One reason is that we won't need to implement
> it if there is no user, another one is that it could potentially weaken
> abstractions?

We had exported our 5V_enable gpio to sysfs to allow a user-space application 
to enable/disable devices connected to 5V circuit.
But on the other hand we had to read the current status of this gpio in the 
power-fail interrupt handler to distinguish between false-positive (5V 
disabled) and a correct detection.
As the sysfs export requests the gpio we cannot gpio_request it in the power-
fail driver and just used gpio_get_value without request.
We set the direction already in the machine startup code and never touched it 
again.

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