Re: [PATCH RFC/RFT 00/15] gpio: sysfs: add a per-chip export/unexport attribute pair

From: Jan Lübbe
Date: Mon Jun 23 2025 - 04:27:41 EST


On Wed, 2025-06-18 at 17:56 +0200, Bartosz Golaszewski wrote:
> On Wed, Jun 18, 2025 at 3:38 PM Jan Lübbe <jlu@xxxxxxxxxxxxxx> wrote:
> >
>
> [snip]
>
>
> > The contents of /sys/kernel/debug/gpio don't really fit any more:
> > gpiochip10: GPIOs 660-663, parent: i2c/0-0024, pca9570, can sleep:
> > gpio-660 (DUT_PWR_EN |tacd ) out hi
> > gpio-661 (DUT_PWR_DISCH |tacd ) out lo
> > gpio-662 (DUT_PWR_ADCRST |reset ) out lo
> > The header is inconsistent: it uses the 'gpiochip' prefix, but not the base as
> > the old class devices in /sys/class/gpio/. Perhaps something like this?
> > chip10: GPIOs 0-2 (global IDs 660-663), parent: i2c/0-0024, pca9570, can sleep:
> > gpio-0 (660) (DUT_PWR_EN |tacd ) out hi
> > gpio-1 (661) (DUT_PWR_DISCH |tacd ) out lo
> > gpio-2 (662) (DUT_PWR_ADCRST |reset ) out lo
> > If GPIO_SYSFS_LEGACY is disabled, the global IDs could be hidden.
> >
>
> After a second look: IMO this is unrelated to the sysfs changes. We
> definitely should change the debugfs output and rid it off the global
> numbers but it shouldn't be part of this series.

Agreed.

> Also: are you using
> this output in some way? Technically debugfs output is not stable ABI
> so we can modify it without considering existing users but wanted to
> run it by you to know if I'm going to break something for you.

We're not parsing debugfs. :) I just checked manually if it matched the new
naming and saw that it didn't.

Regards,
Jan
--
Pengutronix e.K. | |
Steuerwalder Str. 21 | http://www.pengutronix.de/ |
31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |