From: stigge@antcom.de (Roland Stigge)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API
Date: Fri, 19 Oct 2012 13:51:12 +0200 [thread overview]
Message-ID: <50813EB0.9040102@antcom.de> (raw)
In-Reply-To: <CACRpkda35jKs9YVNDAo96=0QzdMi+jkvJAzM=nX+HCK-d5+e9Q@mail.gmail.com>
On 10/19/2012 12:35 PM, Linus Walleij wrote:
> On Thu, Oct 18, 2012 at 12:07 PM, Roland Stigge <stigge@antcom.de> wrote:
>> On 10/17/2012 09:05 PM, Greg KH wrote:
>>>>
>>>> + if (value != exported) {
>>>> + if (value)
>>>> + status = gpio_block_value_export(block);
>>>> + else
>>>> + status = gpio_block_value_unexport(block);
>>>
>>> That looks like a recipie for disaster. Why do you allow userspace to
>>> do this?
>>
>> Exporting for gpio blocks is done as follows: writing "1" to the
>> "exported" _device_ attribute of the gpio block creates the "values"
>> attribute and at the same time requests the whole block (including all
>> of its gpios) as "sysfs".
>
> To me it reads like Greg's comment is basically pinpointing a flaw
> in Brownell's initial design of gpio sysfs: that new sysfs files are
> created and destroyed by writing into sysfs */export files from
> userspace?
>
> See commit: d8f388d8dc8d4f36539dd37c1fff62cc404ea0fc
>
> The block GPIO stuff is just following that design pattern.
So what do you think about my just proposed idea of always having the
"value" argument present, but only useable when "exported" is "1"? Now
only talking about the block gpios, but later maybe also for gpios?
But I would only do this if you and Greg consider it reasonable.
Thanks in advance,
Roland
next prev parent reply other threads:[~2012-10-19 11:51 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-17 12:31 [PATCH RFC 00/15 v5] gpio: Add block GPIO Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 01/15 v5] gpio: Add a block GPIO API to gpiolib Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 02/15 v5] gpio: Add sysfs support to block GPIO API Roland Stigge
2012-10-17 19:05 ` Greg KH
2012-10-18 10:07 ` Roland Stigge
2012-10-19 10:35 ` Linus Walleij
2012-10-19 11:51 ` Roland Stigge [this message]
2012-10-22 8:55 ` Linus Walleij
2012-10-22 9:05 ` Roland Stigge
2012-10-19 18:02 ` Greg KH
2012-10-22 8:54 ` Linus Walleij
2012-10-17 12:31 ` [PATCH RFC 03/15 v5] gpiolib: Fix default attributes for class Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 04/15 v5] gpio: Add device tree support to block GPIO API Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 05/15 v5] gpio-max730x: Add " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 06/15 v5] gpio-lpc32xx: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 07/15 v5] gpio-generic: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 08/15 v5] gpio-pca953x: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 09/15 v5] gpio-em: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 10/15 v5] gpio-pl061: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 11/15 v5] gpio-max732x: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 12/15 v5] gpio-pcf857x: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 13/15 v5] gpio-xilinx: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 14/15 v5] gpio-vt8500: " Roland Stigge
2012-10-17 12:31 ` [PATCH RFC 15/15 v5] gpio-ucb1400: " Roland Stigge
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=50813EB0.9040102@antcom.de \
--to=stigge@antcom.de \
--cc=linux-arm-kernel@lists.infradead.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).