From: Michael Walle <michael@walle.cc>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
bgolaszewski@baylibre.com, linux-gpio@vger.kernel.org
Subject: Re: [PATCH] gpio: Do not trigger WARN() with sysfs gpio export/unexport
Date: Tue, 10 Nov 2020 16:09:10 +0100 [thread overview]
Message-ID: <2ba78a0c9509a65de3155d5e90cc4744@walle.cc> (raw)
In-Reply-To: <CAMRc=MfjWfvKP8ZjU9RA+kgpR9x3pqkGExzMjSerLztLwDV86Q@mail.gmail.com>
Am 2020-11-10 15:40, schrieb Bartosz Golaszewski:
> On Tue, Nov 10, 2020 at 3:31 PM Linus Walleij
> <linus.walleij@linaro.org> wrote:
>>
>> On Fri, Nov 6, 2020 at 12:27 PM Damien Le Moal <Damien.LeMoal@wdc.com>
>> wrote:
>>
>> > It may not be the best interface for regular end users to
>> > manipulate gpios, but it is definitely super useful for developers to do quick
>> > tests of their setup/drivers (which is what I did for my work with the Kendryte
>> > K210 RISC-V SoC support).
>>
>> It is a bit discouraging that RISC-V, which was invented after we
>> already
>> obsoleted the sysfs ABI, is deploying this for development and test.
>>
>> We need to think about a similar facility for users which is less
>> damaging but fulfils the same needs. I think I saw something a while
>> back that looked promising and added some funky files in debugfs
>> in a hierarchical manner per-gpiochip instead. That is how debugfs
>> should be used.
>>
>
> Basically something like what gpio-mockup does for events? Was it
> something out-of-tree or was it on the mailing list?
>
> Also: quick tests have the tendency to become long-term solutions. :)
>
> Is gpioget/gpioset duo difficult/cumbersome to use?
No, but
(1) you have to know that it actually exists. This might be obvious for
you, but I don't know whether every embedded developer is aware
that
there is actually a tool to control GPIOs from userspace. So a
simple
find /sys -name "*gpio*" and figure out how to use it might be his
first choice.
(2) you have to have it installed. If the reference board doesn't come
with it preinstalled, the sysfs is usually easier to get going
because its just there.
> It's a serious
> question - I wrote it in a way that was as user-friendly as possible
> but maybe I'm missing something about sysfs that makes users prefer it
> over a command-line tool. To me sysfs was always a PITA with the
> global numbers etc. but it still seems to stick with others.
That is correct, and I actually find it a lot easier to use than
figuring
out the sysfs numbering, esp. if your DT contains gpio line names. But
there are still old habits (at least in our company).
-michael
next prev parent reply other threads:[~2020-11-10 15:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-04 11:53 [PATCH] gpio: Do not trigger WARN() with sysfs gpio export/unexport Damien Le Moal
2020-11-06 9:27 ` Bartosz Golaszewski
2020-11-06 11:27 ` Damien Le Moal
2020-11-10 14:31 ` Linus Walleij
2020-11-10 14:40 ` Bartosz Golaszewski
2020-11-10 15:09 ` Michael Walle [this message]
2020-11-11 7:14 ` Damien Le Moal
2020-11-11 7:20 ` Damien Le Moal
2020-11-11 7:11 ` Damien Le Moal
2020-11-11 6:54 ` Damien Le Moal
2020-11-11 15:14 ` Linus Walleij
2020-11-19 18:50 ` Geert Uytterhoeven
2020-11-10 14:22 ` Linus Walleij
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=2ba78a0c9509a65de3155d5e90cc4744@walle.cc \
--to=michael@walle.cc \
--cc=Damien.LeMoal@wdc.com \
--cc=bgolaszewski@baylibre.com \
--cc=brgl@bgdev.pl \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.