Re: [PATCH v4 04/10] gpio: swnode: don't use the swnode's name as the key for GPIO lookup

From: Bartosz Golaszewski

Date: Mon Feb 09 2026 - 07:39:10 EST


On Mon, Feb 9, 2026 at 7:44 AM Dmitry Torokhov
<dmitry.torokhov@xxxxxxxxx> wrote:
>
> On Wed, Nov 19, 2025 at 10:13:30AM +0100, Bartosz Golaszewski wrote:
> > On Wed, Nov 19, 2025 at 9:41 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
> > >
> > > On Wed, Nov 19, 2025 at 9:35 AM Bartosz Golaszewski <brgl@xxxxxxxx> wrote:
> > > >
> > > > I have an idea for fixing it, let me cook up a patch. It'll still be a
> > > > bit hacky but will at least create a true link.
> > > >
> > >
> > > Scratch that, I didn't notice before but we register both devices from
> > > MFD core. We can just set up software nodes there.
> > >
> >
> > Here you go: https://lore.kernel.org/all/20251119-cs42l43-gpio-swnodes-v1-1-25996afebd97@xxxxxxxxxx/
> >
> > Please give it a try. This is independent from this series and should
> > probably be backported to stable.
>
> So think breaks more drivers:
>
> https://lore.kernel.org/all/aYkdKfP5fg6iywgr@jekhomev/
>
> I think it may also break:
>
> arch/arm/mach-omap1/board-nokia770.c
> arch/arm/mach-pxa/devices.c
> arch/arm/mach-pxa/devices.h
> arch/arm/mach-pxa/gumstix.c
> arch/arm/mach-pxa/pxa25x.c
> arch/arm/mach-pxa/pxa27x.c
> arch/arm/mach-pxa/spitz.c
> arch/arm/mach-tegra/board-paz00.c

Most of them seem to use software nodes correctly. Nokia 770 could
potentially break depending on the timing but the lookup uses the
right string.

> arch/x86/platform/geode/geode-common.c

Looks like a correct case of referencing the software node to me.

> drivers/platform/x86/barco-p50-gpio.c
> drivers/platform/x86/pcengines-apuv2.c
>

Same here. Nothing here seems to depend on a label and there are real
links between the GPIO chip's and consumer's software nodes.

The problem we triggered here was caused by a GPIO consumer who would
create a bogus software node locally without any real link to the
provider. It would then depend on the provider being named a certain
way to look up its GPIO. That doesn't seem to be the case in the above
files.

Bartosz