Re: [PATCH] gpio: Do not trigger WARN() with sysfs gpio export/unexport

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx> wrote:
> > > 
> > > On Fri, Nov 6, 2020 at 12:27 PM Damien Le Moal <Damien.LeMoal@xxxxxxx> 
> > > 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.

You perfectly described what happened to me :)

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

-- 
Damien Le Moal
Western Digital




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux