All of lore.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <Damien.LeMoal@wdc.com>
To: "michael@walle.cc" <michael@walle.cc>, "brgl@bgdev.pl" <brgl@bgdev.pl>
Cc: "linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
	"bgolaszewski@baylibre.com" <bgolaszewski@baylibre.com>,
	"linus.walleij@linaro.org" <linus.walleij@linaro.org>
Subject: Re: [PATCH] gpio: Do not trigger WARN() with sysfs gpio export/unexport
Date: Wed, 11 Nov 2020 07:20:52 +0000	[thread overview]
Message-ID: <2dc0737490e0f32b4870197df62bd0825d791b5a.camel@wdc.com> (raw)
In-Reply-To: <2ba78a0c9509a65de3155d5e90cc4744@walle.cc>

On Tue, 2020-11-10 at 16:09 +0100, Michael Walle wrote:
> 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.

Forgot to add: I was knew to using gpio in Linux so I started googling "how to"
about it. And all the top hits I got only mentioned sysfs. I actually never saw
any reference to gpioset/gpioget. That includes the references to the kernel
Documentation/admin-guide/gpio/sysfs.rst, which do mention that sysfs is
deprecated (I see that now), but still has the explanation text. May be the
explanation text should be moved to something like documentation/admin-
guide/obsolete/... and keep only the reference to the new tools and char dev ?


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

-- 
Damien Le Moal
Western Digital

  parent reply	other threads:[~2020-11-11  7:20 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
2020-11-11  7:14           ` Damien Le Moal
2020-11-11  7:20           ` Damien Le Moal [this message]
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=2dc0737490e0f32b4870197df62bd0825d791b5a.camel@wdc.com \
    --to=damien.lemoal@wdc.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=brgl@bgdev.pl \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=michael@walle.cc \
    /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.