From: Alexandre Courbot <gnurou@gmail.com>
To: folkert <folkert@vanheusden.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Michael Welling <mwelling@ieee.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: Fw: [3.18.3] poll() on gpio pins broken
Date: Mon, 2 Mar 2015 15:20:15 +0900 [thread overview]
Message-ID: <CAAVeFuLb14vvOJ=7hRsLT7zsHYjj49VTfwbLDRhdrciLqPe_ZA@mail.gmail.com> (raw)
In-Reply-To: <20150227131923.GX21469@belle.intranet.vanheusden.com>
On Fri, Feb 27, 2015 at 10:19 PM, folkert <folkert@vanheusden.com> wrote:
>> > Mmm, I was thinking it would be nice to have a (new, redesigned) sysfs
>> > interface for this. :P
>> >
>> > Aren't we going to make things less accessible if we use a char device?
>>
>> Since sysfs has a "one value per file" paradigm, it also has a
>> "one context switch per operation" paradigm, meaning any
>> efficiency-oriented use cases where a lot of stuff needs to be
>> changed in one context switch are by the very construction
>> not suitable for sysfs IMO. That is the use case for ioctl()
>> operations that can pass an entire struct of stuff over.
>>
>> And things like bit-banging a clock+data line which would in
>> a sysfs case involve two context switches (one per value, since
>> that is one file per GPIO line) in an ioctl() case it would be
>> just one, already 50% less context switches for a very basic
>> use case.
>>
>> But I may be just so wrong ... input welcome.
>
> Another bad thing of the current sysfs versions: it is ascii.
> So I need to convert a=1 to a='1' first before write()ing it to the
> file. Very inconvenient because it adds boilerplate code.
> On the other hand, the sysfs is very much extensible.
write(fd, a == 0 ? '0' : '1', 1);
That doesn't look like too much boilerplate to me. And it can easily
be hidden under a dedicated macro/function.
next prev parent reply other threads:[~2015-03-02 6:20 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-29 15:29 Fw: [3.18.3] poll() on gpio pins broken folkert
2015-01-30 23:45 ` Michael Welling
2015-01-31 8:33 ` folkert
2015-01-31 13:39 ` Alexandre Courbot
2015-01-31 13:53 ` folkert
2015-02-03 9:03 ` Michael Welling
2015-02-13 3:43 ` Linus Walleij
2015-02-19 8:53 ` folkert
2015-02-19 16:52 ` Linus Walleij
2015-02-26 10:27 ` Alexandre Courbot
2015-02-27 13:15 ` Linus Walleij
2015-02-27 13:19 ` folkert
2015-03-02 6:20 ` Alexandre Courbot [this message]
2015-03-02 6:16 ` Alexandre Courbot
2015-03-02 7:27 ` Michael Welling
2015-03-03 8:27 ` Alexandre Courbot
2015-03-03 10:31 ` Linus Walleij
2015-03-04 12:43 ` Alexandre Courbot
2015-03-09 15:52 ` Linus Walleij
2015-03-09 19:02 ` folkert
2015-03-09 20:22 ` Michael Welling
2015-03-17 16:39 ` Linus Walleij
2015-03-17 16:47 ` Michael Welling
2015-03-19 8:30 ` Linus Walleij
2015-02-26 10:29 ` Alexandre Courbot
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='CAAVeFuLb14vvOJ=7hRsLT7zsHYjj49VTfwbLDRhdrciLqPe_ZA@mail.gmail.com' \
--to=gnurou@gmail.com \
--cc=folkert@vanheusden.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=mwelling@ieee.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).