linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>
Cc: "Ahmad Fatoum" <a.fatoum@pengutronix.de>,
	"Kent Gibson" <warthog618@gmail.com>,
	"Jan Lübbe" <jlu@pengutronix.de>,
	"Geert Uytterhoeven" <geert+renesas@glider.be>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: Replacing global GPIO numbers in sysfs with hardware offsets
Date: Fri, 21 Feb 2025 19:01:35 +0100	[thread overview]
Message-ID: <e5bdcca6-4d1b-451c-8fde-990db9db23d8@denx.de> (raw)
In-Reply-To: <CACRpkdZXm9eFJ2nzb5Gsm_ddirt6XZTQyu2G+vX2FB+=L6Lttw@mail.gmail.com>

On 2/14/25 10:14 AM, Linus Walleij wrote:
> On Sun, Feb 2, 2025 at 1:46 PM Bartosz Golaszewski <brgl@bgdev.pl> wrote:

Hi,

I'm sorry for the late reply.

>> I think it was Ahmad or Marek who suggested that users aren't really
>> attached to the global numbering but to the ease of use of sysfs.
>>
>> I floated an idea of introducing a backward compatible change to sysfs
>> that would allow users to identify GPIOs by the label of their parent
>> chip and the hardware offset of the line within that chip (...)
>>
>> We could then encourage users to switch to using the chip-local
>> exports and eventually at least remove the global export/unexport pair
>> if we cannot make the entire sysfs class go away.
>>
>> Please let me know what you think about it?
> 
> Yes, I think it is mostly equivalent to what I say in drivers/gpio/TODO,
> my only point being that when we add something like this, we
> put it in debugfs where it belongs, and as illustrated by your
> example, it is indeed used for debugging/exploring the
> system:

I would very much like to avoid having to enable debugfs on production 
systems to access GPIOs in early userspace (e.g. initramfs). This was so 
far possible via the sysfs API without tools, currently it is becoming 
not easily possible. A sysfs API "v2" which makes that possible would be 
very much appreciated.

Also note that I do not care about static GPIO number assignment in the 
sysfs API, so that part can go.

> ----------------8<----------------------------8<------------------------
> Debugfs in place of sysfs
> 
> The old sysfs code that enables simple uses of GPIOs from the
> command line is still popular despite the existance of the proper
> character device. The reason is that it is simple to use on
> root filesystems where you only have a minimal set of tools such
> as "cat", "echo" etc.

Yes

> The old sysfs still need to be strongly deprecated and removed
> as it relies on the global GPIO numberspace that assume a strict
> order of global GPIO numbers that do not change between boots
> and is independent of probe order.

Yes

> To solve this and provide an ABI that people can use for hacks
> and development, implement a debugfs

sysfs please.

[...]

  reply	other threads:[~2025-02-21 19:41 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-02 12:45 Replacing global GPIO numbers in sysfs with hardware offsets Bartosz Golaszewski
2025-02-03 14:23 ` Geert Uytterhoeven
2025-02-07 20:18   ` Bartosz Golaszewski
2025-02-09  9:40     ` Geert Uytterhoeven
2025-02-25 18:25       ` Ayush Singh
2025-02-25 20:20         ` Linus Walleij
2025-02-26  6:25           ` Ayush Singh
2025-02-14  9:14 ` Linus Walleij
2025-02-21 18:01   ` Marek Vasut [this message]
2025-02-25 19:54     ` Linus Walleij
2025-02-26 12:36       ` Marek Vasut
2025-02-26 19:07         ` Bartosz Golaszewski
2025-02-28  7:49         ` Linus Walleij
2025-02-28  8:49           ` Geert Uytterhoeven
2025-02-28  8:55             ` Linus Walleij
2025-02-28  9:53               ` Geert Uytterhoeven
2025-03-05  8:22                 ` Linus Walleij
2025-03-05  8:41                   ` Kent Gibson
2025-03-11 10:28                 ` Bartosz Golaszewski
2025-03-11 10:52                   ` Geert Uytterhoeven
2025-03-11 11:53                     ` Bartosz Golaszewski
2025-03-11 15:26                       ` Geert Uytterhoeven
2025-02-21 19:56   ` Ahmad Fatoum
2025-02-25 19:56     ` Linus Walleij
2025-02-24  1:49 ` Kent Gibson
2025-02-24  8:28   ` Geert Uytterhoeven
2025-02-26  9:23   ` Bartosz Golaszewski
2025-02-26 10:58     ` Kent Gibson

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=e5bdcca6-4d1b-451c-8fde-990db9db23d8@denx.de \
    --to=marex@denx.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=brgl@bgdev.pl \
    --cc=geert+renesas@glider.be \
    --cc=jlu@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=warthog618@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 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).