All of lore.kernel.org
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Johan Hovold <johan@kernel.org>,
	Bartosz Golaszewski <bgolaszewski@baylibre.com>
Cc: Geert Uytterhoeven <geert+renesas@glider.be>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Greg KH <gregkh@linuxfoundation.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	patong.mxl@gmail.com,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Angelo Dureghello <angelo.dureghello@timesys.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v5 2/3] usb: serial: xr_serial: Add gpiochip support
Date: Wed, 9 Dec 2020 17:25:32 +0100	[thread overview]
Message-ID: <CACRpkdYm-j9QcK8hgNrC33KruWE17Q0F4+T=UanE7PCEZEtu6w@mail.gmail.com> (raw)
In-Reply-To: <X9DsWahl6UDwZwBn@localhost>

On Wed, Dec 9, 2020 at 4:24 PM Johan Hovold <johan@kernel.org> wrote:
> On Tue, Dec 08, 2020 at 01:41:52PM +0100, Linus Walleij wrote:

> > depends on !GPIO_SYSFS
> >
> > so it can't even be compiled in if someone is using the sysfs.
> >
> > That should solve the situation where people are (ab)using
> > the sysfs and getting name collisions as a result.
>
> Would it possible to set a flag to suppress just the sysfs entry
> renaming instead?

Hm you mean that when a GPIO is "exported" in sysfs
it should not get a symbolic name from the names but instead
just the number?

I bet someone has written their scripts to take advantage of
the symbolic names so I suspect the task becomes bigger
like suppress the sysfs entry renaming if and only if there is
a namespace collision.

But I think we can do that, doesn't seem too hard?

I just hacked up this:
https://lore.kernel.org/linux-gpio/20201209161821.92931-1-linus.walleij@linaro.org/T/#u

> Despite its flaws the sysfs interface is still very convenient and I'd
> prefer not to disable it just because of the line names.

Would these conveniences be identical to those listed
in my recent TODO entry?
https://lore.kernel.org/linux-gpio/20201204083533.65830-1-linus.walleij@linaro.org/

There are several other issues with the sysfs, so making it conflict
with other drivers is almost  plus in the direction of discouragement
from the GPIO submaintainer point of view, but I do see that
people like it for the reasons in the TODO. :/

I am strongly encouraging any developer with a few spare cycles
on their hands to go and implement the debugfs facility because
we can make it so much better than the sysfs, easier and
more convenient for testing etc.

> > Then it should be fine for any driver to provide a names array
> > provided all the names are unique on that gpiochip.
>
> So it sounds like there's nothing preventing per-chip-unique names in
> the rest of gpiolib and the new chardev interface then? Are the
> user-space libraries able to cope with it, etc?

Yes the documentation refers to libgpiod a very well maintained
library:
https://www.kernel.org/doc/html/latest/driver-api/gpio/using-gpio.html
https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/

Then there are the the example tools included with the kernel
that provide a second implementation for the same interfaces
using just the C standard library:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/tools/gpio

I usually use the tools myself.

Yours,
Linus Walleij

  reply	other threads:[~2020-12-09 16:26 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-22 17:08 [PATCH v5 0/3] Add support for MaxLinear/Exar USB to serial converters Manivannan Sadhasivam
2020-11-22 17:08 ` [PATCH v5 1/3] usb: serial: Add MaxLinear/Exar USB to Serial driver Manivannan Sadhasivam
2021-01-21 10:19   ` Johan Hovold
2021-01-26 15:46     ` Manivannan Sadhasivam
2021-01-26 16:26       ` Johan Hovold
2021-02-22 15:27         ` Mauro Carvalho Chehab
2021-02-22 15:47           ` Johan Hovold
2021-02-24  8:51             ` Mauro Carvalho Chehab
2021-02-25 17:58             ` Mauro Carvalho Chehab
2021-02-25 18:04               ` Mauro Carvalho Chehab
2021-02-26 10:07                 ` Johan Hovold
2021-02-26 10:37                   ` Mauro Carvalho Chehab
2020-11-22 17:08 ` [PATCH v5 2/3] usb: serial: xr_serial: Add gpiochip support Manivannan Sadhasivam
2020-12-01 14:37   ` Linus Walleij
2020-12-01 15:51     ` Johan Hovold
2020-12-05 22:21       ` Linus Walleij
2020-12-08  9:58         ` Johan Hovold
2020-12-08 12:41           ` Linus Walleij
2020-12-08 12:52             ` Manivannan Sadhasivam
2020-12-09 15:31               ` Johan Hovold
2020-12-09 15:25             ` Johan Hovold
2020-12-09 16:25               ` Linus Walleij [this message]
2020-12-10  8:53                 ` Johan Hovold
2020-12-10  9:04                   ` Johan Hovold
2020-12-12  0:03                   ` Linus Walleij
2020-12-14  8:58                     ` Johan Hovold
2020-12-14  9:19                       ` Linus Walleij
2020-12-14  9:31                         ` Johan Hovold
2020-12-01 18:00     ` Manivannan Sadhasivam
2021-01-21 11:06   ` Johan Hovold
2020-11-22 17:08 ` [PATCH v5 3/3] usb: cdc-acm: Ignore Exar XR21V141X when serial driver is built Manivannan Sadhasivam
2021-01-21 10:23   ` Johan Hovold
2020-12-08 10:51 ` [PATCH v5 0/3] Add support for MaxLinear/Exar USB to serial converters Manivannan Sadhasivam
2020-12-14  9:51   ` Johan Hovold

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='CACRpkdYm-j9QcK8hgNrC33KruWE17Q0F4+T=UanE7PCEZEtu6w@mail.gmail.com' \
    --to=linus.walleij@linaro.org \
    --cc=angelo.dureghello@timesys.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=geert+renesas@glider.be \
    --cc=gregkh@linuxfoundation.org \
    --cc=johan@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=patong.mxl@gmail.com \
    /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.