linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: Bartosz Golaszewski <brgl@bgdev.pl>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
	Linus Walleij <linus.walleij@linaro.org>,
	Andy Whitcroft <apw@canonical.com>, Joe Perches <joe@perches.com>,
	Dwaipayan Ray <dwaipayanray1@gmail.com>,
	Lukas Bulwahn <lukas.bulwahn@gmail.com>,
	Fabio Estevam <festevam@gmail.com>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Haibo Chen <haibo.chen@nxp.com>,
	Catalin Popescu <catalin.popescu@leica-geosystems.com>,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 0/4] gpio: mxc: silence warning about GPIO base being statically allocated
Date: Tue, 21 Jan 2025 11:37:18 +0100	[thread overview]
Message-ID: <3f21523b-816e-488c-bf0a-c6677c375a18@pengutronix.de> (raw)
In-Reply-To: <CAMRc=MdYB_XHCaurs1mO+KGX7rB5zFT3zCi=UbNY0rSbMEJdWw@mail.gmail.com>

Hello Bartosz,

On 15.01.25 17:52, Bartosz Golaszewski wrote:
> On Tue, Jan 14, 2025 at 10:55 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>
>> Hi Andy,
>>
>> On 14.01.25 10:46, Andy Shevchenko wrote:
>>> On Tue, Jan 14, 2025 at 12:19 AM Ahmad Fatoum <a.fatoum@pengutronix.de> wrote:
>>>>
>>>> The i.MX GPIO driver has had deterministic numbering for the GPIOs
>>>> for more than 12 years.
>>>>
>>>> Reverting this to dynamically numbered will break existing setups in the
>>>> worst manner possible: The build will succeed, the kernel will not print
>>>> warnings, but users will find their devices essentially toggling GPIOs
>>>> at random with the potential of permanent damage. We thus want to keep
>>>> the numbering as-is until the SysFS API is removed and script fail
>>>> instead of toggling GPIOs dependent on probe order.
>>>
>>> While I understand the issue this tends to get never fixed until the
>>> entire support of iMX boards will be dropped.
>>
>> i.MX is an actively developed and widely used platform. Why should support
>> be dropped?
>>
>>> Personally I do not like
>>> this series at all. Rather let's try to go the hard way and understand
>>> what's going on to fix the current issues.
>>
>> /sys/class/gpio is deprecated and when it is finally removed, this series can
>> be reverted again. The alternatives are either do nothing and live with 6 kernel
>> warnings cluttering every boot or show users the finger as described in
>> the cover letter.
>>
>> Do you see a different path forward?
>>
> 
> I recently wrote a user-space compatibility layer for sysfs[1]. While
> right now it doesn't support static base numbers, I'm very open to
> adding it except that I wasn't sure how to approach it.
> 
> Is this of any use to you and could it help you switch to libgpiod
> without changing your user-space set-up (given the support for static
> GPIO numbering)?

If the goal is to have a drop-in replacement for sysfs outside
of the kernel, I think it needs to maintain the same numbering.

I am not sure I see myself using it, because the new projects are using
libgpiod from the get-go. My issue is not with removal of sysfs, but with
user hostile deprecation approaches.

> If so, how would you like to see this implemented? A
> config file at /etc that would list chip labels and their desired GPIO
> base?

Many GPIOs tend to not have labels. I think the mapping config file
should rather map GPIO controllers to a base address. The same thing the
kernel is currently doing. This assumes the numbering of the built-in
GPIO controllers is deterministic, e.g. by consulting /aliases. I haven't
checked, but I hope this is already the case.

Cheers,
Ahmad

> 
> Bartosz
> 
> [1] https://github.com/brgl/gpiod-sysfs-proxy
> 


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

  reply	other threads:[~2025-01-21 10:37 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-13 22:19 [PATCH 0/4] gpio: mxc: silence warning about GPIO base being statically allocated Ahmad Fatoum
2025-01-13 22:19 ` [PATCH 1/4] gpiolib: add opt-out for existing drivers with static GPIO base Ahmad Fatoum
2025-01-14  9:49   ` Andy Shevchenko
2025-01-14 10:06     ` Ahmad Fatoum
2025-01-14 19:38       ` Andy Shevchenko
2025-01-15  7:07         ` Ahmad Fatoum
2025-01-15 13:04           ` Kent Gibson
2025-01-21 10:26             ` Ahmad Fatoum
2025-01-15 12:00   ` Linus Walleij
2025-01-21 11:34     ` Ahmad Fatoum
2025-01-13 22:19 ` [PATCH 2/4] checkpatch: warn about use of legacy_static_base Ahmad Fatoum
2025-01-14 14:37   ` Linus Walleij
2025-01-13 22:19 ` [PATCH 3/4] gpio: mxc: remove dead code after switch to DT-only Ahmad Fatoum
2025-01-14  9:51   ` Andy Shevchenko
2025-01-15 16:55   ` Bartosz Golaszewski
2025-01-21 10:16     ` Ahmad Fatoum
2025-01-13 22:19 ` [PATCH 4/4] gpio: mxc: silence warning about GPIO base being statically allocated Ahmad Fatoum
2025-01-14  9:46 ` [PATCH 0/4] " Andy Shevchenko
2025-01-14  9:55   ` Ahmad Fatoum
2025-01-14 19:43     ` Andy Shevchenko
2025-01-15  7:03       ` Ahmad Fatoum
2025-01-15 15:16         ` Andy Shevchenko
2025-01-21 11:16           ` Ahmad Fatoum
2025-01-15 16:52     ` Bartosz Golaszewski
2025-01-21 10:37       ` Ahmad Fatoum [this message]
2025-01-23  9:19         ` Bartosz Golaszewski
2025-01-23  8:06 ` (subset) " Bartosz Golaszewski

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=3f21523b-816e-488c-bf0a-c6677c375a18@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=andy.shevchenko@gmail.com \
    --cc=apw@canonical.com \
    --cc=brgl@bgdev.pl \
    --cc=catalin.popescu@leica-geosystems.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=dwaipayanray1@gmail.com \
    --cc=festevam@gmail.com \
    --cc=haibo.chen@nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=joe@perches.com \
    --cc=kernel@pengutronix.de \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    /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).