* [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
@ 2025-07-26 21:10 Arnd Bergmann
2025-07-27 8:27 ` Bartosz Golaszewski
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Arnd Bergmann @ 2025-07-26 21:10 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Arnd Bergmann,
Alexander Sverdlin
Cc: kernel test robot, Peng Fan, Koichiro Den, Lee Jones,
Geert Uytterhoeven, André Draszik, Nikolaos Pasaloukos,
Thomas Richard, Yixun Lan, Lars-Peter Clausen, Andy Shevchenko,
linux-gpio, linux-kernel
From: Arnd Bergmann <arnd@arndb.de>
A few drivers that use the legacy GPIOLIB interfaces can be enabled
even when GPIOLIB is disabled entirely. With my previous patch this
now causes build failures like:
drivers/nfc/s3fwrn5/uart.c: In function 's3fwrn82_uart_parse_dt':
drivers/nfc/s3fwrn5/uart.c:100:14: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
These did not show up in my randconfig tests because randconfig almost
always has GPIOLIB selected by some other driver, and I did most
of the testing with follow-up patches that address the failures
properly.
Move the symbol outside of the 'if CONFIG_GPIOLIB' block for the moment
to avoid the build failures. It can be moved back and turned off by
default once all the driver specific changes are merged.
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202507261934.yIHeUuEQ-lkp@intel.com/
Fixes: 678bae2eaa81 ("gpiolib: make legacy interfaces optional")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
drivers/gpio/Kconfig | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
index 8bda3c9d47b4..c48f9badb513 100644
--- a/drivers/gpio/Kconfig
+++ b/drivers/gpio/Kconfig
@@ -12,11 +12,11 @@ menuconfig GPIOLIB
If unsure, say N.
-if GPIOLIB
-
config GPIOLIB_LEGACY
def_bool y
+if GPIOLIB
+
config GPIOLIB_FASTPATH_LIMIT
int "Maximum number of GPIOs for fast path"
range 32 512
--
2.39.5
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-26 21:10 [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB Arnd Bergmann
@ 2025-07-27 8:27 ` Bartosz Golaszewski
2025-07-29 10:47 ` Geert Uytterhoeven
2025-08-13 22:26 ` Rob Herring
2 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2025-07-27 8:27 UTC (permalink / raw)
To: Linus Walleij, Bartosz Golaszewski, Arnd Bergmann,
Alexander Sverdlin, Arnd Bergmann
Cc: Bartosz Golaszewski, kernel test robot, Peng Fan, Koichiro Den,
Lee Jones, Geert Uytterhoeven, André Draszik,
Nikolaos Pasaloukos, Thomas Richard, Yixun Lan,
Lars-Peter Clausen, Andy Shevchenko, linux-gpio, linux-kernel
From: Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
On Sat, 26 Jul 2025 23:10:43 +0200, Arnd Bergmann wrote:
> A few drivers that use the legacy GPIOLIB interfaces can be enabled
> even when GPIOLIB is disabled entirely. With my previous patch this
> now causes build failures like:
>
> drivers/nfc/s3fwrn5/uart.c: In function 's3fwrn82_uart_parse_dt':
> drivers/nfc/s3fwrn5/uart.c:100:14: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
>
> [...]
Applied, thanks!
[1/1] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
https://git.kernel.org/brgl/linux/c/a86240a37d43fc22b4e4953242fca8d90df2c555
Best regards,
--
Bartosz Golaszewski <bartosz.golaszewski@linaro.org>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-26 21:10 [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB Arnd Bergmann
2025-07-27 8:27 ` Bartosz Golaszewski
@ 2025-07-29 10:47 ` Geert Uytterhoeven
2025-07-29 11:57 ` Arnd Bergmann
2025-08-13 22:26 ` Rob Herring
2 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2025-07-29 10:47 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Linus Walleij, Bartosz Golaszewski, Arnd Bergmann,
Alexander Sverdlin, kernel test robot, Peng Fan, Koichiro Den,
Lee Jones, Geert Uytterhoeven, André Draszik,
Nikolaos Pasaloukos, Thomas Richard, Yixun Lan,
Lars-Peter Clausen, Andy Shevchenko, linux-gpio, linux-kernel
Hi Arnd,
On Sat, 26 Jul 2025 at 23:11, Arnd Bergmann <arnd@kernel.org> wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> A few drivers that use the legacy GPIOLIB interfaces can be enabled
> even when GPIOLIB is disabled entirely. With my previous patch this
> now causes build failures like:
>
> drivers/nfc/s3fwrn5/uart.c: In function 's3fwrn82_uart_parse_dt':
> drivers/nfc/s3fwrn5/uart.c:100:14: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
>
> These did not show up in my randconfig tests because randconfig almost
> always has GPIOLIB selected by some other driver, and I did most
> of the testing with follow-up patches that address the failures
> properly.
>
> Move the symbol outside of the 'if CONFIG_GPIOLIB' block for the moment
> to avoid the build failures. It can be moved back and turned off by
> default once all the driver specific changes are merged.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507261934.yIHeUuEQ-lkp@intel.com/
> Fixes: 678bae2eaa81 ("gpiolib: make legacy interfaces optional")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Thanks for your patch, which is now commit a86240a37d43fc22 ("gpiolib:
enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB") in linus/master
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -12,11 +12,11 @@ menuconfig GPIOLIB
>
> If unsure, say N.
>
> -if GPIOLIB
> -
> config GPIOLIB_LEGACY
> def_bool y
>
> +if GPIOLIB
> +
> config GPIOLIB_FASTPATH_LIMIT
> int "Maximum number of GPIOs for fast path"
> range 32 512
This won't work for everything.
While I now get CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, and
simple inline functions like gpio_is_valid() are now available, more
complex functions will still fail, as drivers/gpio/gpiolib-legacy.c
is not built.
drivers/Makefile:
obj-$(CONFIG_GPIOLIB) += gpio/
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-29 10:47 ` Geert Uytterhoeven
@ 2025-07-29 11:57 ` Arnd Bergmann
2025-07-29 12:12 ` Geert Uytterhoeven
0 siblings, 1 reply; 8+ messages in thread
From: Arnd Bergmann @ 2025-07-29 11:57 UTC (permalink / raw)
To: Geert Uytterhoeven, Arnd Bergmann
Cc: Linus Walleij, Bartosz Golaszewski, Alexander Sverdlin,
kernel test robot, Peng Fan, Koichiro Den, Lee Jones,
Geert Uytterhoeven, André Draszik, Niko Pasaloukos,
Thomas Richard, Yixun Lan, Lars-Peter Clausen, Andy Shevchenko,
open list:GPIO SUBSYSTEM, linux-kernel
On Tue, Jul 29, 2025, at 12:47, Geert Uytterhoeven wrote:
>>
>> -if GPIOLIB
>> -
>> config GPIOLIB_LEGACY
>> def_bool y
>>
>> +if GPIOLIB
>> +
>> config GPIOLIB_FASTPATH_LIMIT
>> int "Maximum number of GPIOs for fast path"
>> range 32 512
>
> This won't work for everything.
> While I now get CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, and
> simple inline functions like gpio_is_valid() are now available, more
> complex functions will still fail, as drivers/gpio/gpiolib-legacy.c
> is not built.
>
> drivers/Makefile:
>
> obj-$(CONFIG_GPIOLIB) += gpio/
>
Hi Geert,
Do you have an example config that shows this problem?
I've tried a couple of configurations on m68k now but are unable
to reproduce this, using 'defconfig' (without GPIOLIB) and
'm5475evb_defconfig' (with GPIOLIB).
The intention of this patch (in combination with the previous one)
was that the legacy interfaces would still behave exactly like
before, falling back to the stubs when GPIOLIB is disabled.
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-29 11:57 ` Arnd Bergmann
@ 2025-07-29 12:12 ` Geert Uytterhoeven
2025-07-29 14:11 ` Arnd Bergmann
0 siblings, 1 reply; 8+ messages in thread
From: Geert Uytterhoeven @ 2025-07-29 12:12 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Arnd Bergmann, Linus Walleij, Bartosz Golaszewski,
Alexander Sverdlin, kernel test robot, Peng Fan, Koichiro Den,
Lee Jones, Geert Uytterhoeven, André Draszik,
Niko Pasaloukos, Thomas Richard, Yixun Lan, Lars-Peter Clausen,
Andy Shevchenko, open list:GPIO SUBSYSTEM, linux-kernel
Hi Arnd,
On Tue, 29 Jul 2025 at 13:58, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tue, Jul 29, 2025, at 12:47, Geert Uytterhoeven wrote:
> >>
> >> -if GPIOLIB
> >> -
> >> config GPIOLIB_LEGACY
> >> def_bool y
> >>
> >> +if GPIOLIB
> >> +
> >> config GPIOLIB_FASTPATH_LIMIT
> >> int "Maximum number of GPIOs for fast path"
> >> range 32 512
> >
> > This won't work for everything.
> > While I now get CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, and
> > simple inline functions like gpio_is_valid() are now available, more
> > complex functions will still fail, as drivers/gpio/gpiolib-legacy.c
> > is not built.
> >
> > drivers/Makefile:
> >
> > obj-$(CONFIG_GPIOLIB) += gpio/
> Do you have an example config that shows this problem?
> I've tried a couple of configurations on m68k now but are unable
> to reproduce this, using 'defconfig' (without GPIOLIB) and
> 'm5475evb_defconfig' (with GPIOLIB).
>
> The intention of this patch (in combination with the previous one)
> was that the legacy interfaces would still behave exactly like
> before, falling back to the stubs when GPIOLIB is disabled.
I haven't seen any actual failures. When discovering
CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, my initial worry
was that it would increase kernel size by needlessly including
gpiolib-legacy.o. When that didn't turn out to be true, I started
wondering how your commit would fix anything without including
gpiolib-legacy.o. Looks like any users just uses the simple static
inlines...
Sorry for confusing you.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-29 12:12 ` Geert Uytterhoeven
@ 2025-07-29 14:11 ` Arnd Bergmann
0 siblings, 0 replies; 8+ messages in thread
From: Arnd Bergmann @ 2025-07-29 14:11 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Arnd Bergmann, Linus Walleij, Bartosz Golaszewski,
Alexander Sverdlin, kernel test robot, Peng Fan, Koichiro Den,
Lee Jones, Geert Uytterhoeven, André Draszik,
Niko Pasaloukos, Thomas Richard, Yixun Lan, Lars-Peter Clausen,
Andy Shevchenko, open list:GPIO SUBSYSTEM, linux-kernel
On Tue, Jul 29, 2025, at 14:12, Geert Uytterhoeven wrote:
> On Tue, 29 Jul 2025 at 13:58, Arnd Bergmann <arnd@arndb.de> wrote:
>> On Tue, Jul 29, 2025, at 12:47, Geert Uytterhoeven wrote:
>> Do you have an example config that shows this problem?
>> I've tried a couple of configurations on m68k now but are unable
>> to reproduce this, using 'defconfig' (without GPIOLIB) and
>> 'm5475evb_defconfig' (with GPIOLIB).
>>
>> The intention of this patch (in combination with the previous one)
>> was that the legacy interfaces would still behave exactly like
>> before, falling back to the stubs when GPIOLIB is disabled.
>
> I haven't seen any actual failures. When discovering
> CONFIG_GPIOLIB_LEGACY=y in all m68k defconfigs, my initial worry
> was that it would increase kernel size by needlessly including
> gpiolib-legacy.o. When that didn't turn out to be true, I started
> wondering how your commit would fix anything without including
> gpiolib-legacy.o. Looks like any users just uses the simple static
> inlines...
> Sorry for confusing you.
No worries, thanks for paying attention to incoming changes!
If you want to see what the actual plan is, have a look at
https://git.kernel.org/pub/scm/linux/kernel/git/arnd/playground.git/log/?h=config-gpio-legacy
which ends with making GPIOLIB_LEGACY actually optional.
Any driver that actually uses the legacy gpiolib interfaces
at that point is already specific to one of the few platforms
that still have legacy gpiochips (sh, sa1100, pxa, s3c64xx,
orion5x, mv78xx0, coldfire, alchemy, txx9, bcm47xx, bcm63xx,
rb532, olpc, and a few x86 atom boards), or it has an explicit
dependency on GPIOLIB_LEGACY.
The arm boards are already on their way out, but the others
could probably use some help converting to gpio descriptors.
Arnd
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-07-26 21:10 [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB Arnd Bergmann
2025-07-27 8:27 ` Bartosz Golaszewski
2025-07-29 10:47 ` Geert Uytterhoeven
@ 2025-08-13 22:26 ` Rob Herring
2025-09-01 11:44 ` Bartosz Golaszewski
2 siblings, 1 reply; 8+ messages in thread
From: Rob Herring @ 2025-08-13 22:26 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Linus Walleij, Bartosz Golaszewski, Arnd Bergmann,
Alexander Sverdlin, kernel test robot, Peng Fan, Koichiro Den,
Lee Jones, Geert Uytterhoeven, André Draszik,
Nikolaos Pasaloukos, Thomas Richard, Yixun Lan,
Lars-Peter Clausen, Andy Shevchenko, linux-gpio, linux-kernel
On Sat, Jul 26, 2025 at 11:10:43PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> A few drivers that use the legacy GPIOLIB interfaces can be enabled
> even when GPIOLIB is disabled entirely. With my previous patch this
> now causes build failures like:
>
> drivers/nfc/s3fwrn5/uart.c: In function 's3fwrn82_uart_parse_dt':
> drivers/nfc/s3fwrn5/uart.c:100:14: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
>
> These did not show up in my randconfig tests because randconfig almost
> always has GPIOLIB selected by some other driver, and I did most
> of the testing with follow-up patches that address the failures
> properly.
>
> Move the symbol outside of the 'if CONFIG_GPIOLIB' block for the moment
> to avoid the build failures. It can be moved back and turned off by
> default once all the driver specific changes are merged.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes: https://lore.kernel.org/oe-kbuild-all/202507261934.yIHeUuEQ-lkp@intel.com/
> Fixes: 678bae2eaa81 ("gpiolib: make legacy interfaces optional")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> drivers/gpio/Kconfig | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
This change causes all of the GPIO submenu to show up directly in the
already way too long 'Device Drivers' menu.
>
> diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> index 8bda3c9d47b4..c48f9badb513 100644
> --- a/drivers/gpio/Kconfig
> +++ b/drivers/gpio/Kconfig
> @@ -12,11 +12,11 @@ menuconfig GPIOLIB
>
> If unsure, say N.
>
> -if GPIOLIB
> -
> config GPIOLIB_LEGACY
> def_bool y
Perhaps this has to be before "menuconfig GPIOLIB"?
>
> +if GPIOLIB
> +
> config GPIOLIB_FASTPATH_LIMIT
> int "Maximum number of GPIOs for fast path"
> range 32 512
> --
> 2.39.5
>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB
2025-08-13 22:26 ` Rob Herring
@ 2025-09-01 11:44 ` Bartosz Golaszewski
0 siblings, 0 replies; 8+ messages in thread
From: Bartosz Golaszewski @ 2025-09-01 11:44 UTC (permalink / raw)
To: Rob Herring
Cc: Arnd Bergmann, Linus Walleij, Arnd Bergmann, Alexander Sverdlin,
kernel test robot, Peng Fan, Koichiro Den, Lee Jones,
Geert Uytterhoeven, André Draszik, Nikolaos Pasaloukos,
Thomas Richard, Yixun Lan, Lars-Peter Clausen, Andy Shevchenko,
linux-gpio, linux-kernel
On Thu, Aug 14, 2025 at 12:26 AM Rob Herring <robh@kernel.org> wrote:
>
> On Sat, Jul 26, 2025 at 11:10:43PM +0200, Arnd Bergmann wrote:
> > From: Arnd Bergmann <arnd@arndb.de>
> >
> > A few drivers that use the legacy GPIOLIB interfaces can be enabled
> > even when GPIOLIB is disabled entirely. With my previous patch this
> > now causes build failures like:
> >
> > drivers/nfc/s3fwrn5/uart.c: In function 's3fwrn82_uart_parse_dt':
> > drivers/nfc/s3fwrn5/uart.c:100:14: error: implicit declaration of function 'gpio_is_valid'; did you mean 'uuid_is_valid'? [-Werror=implicit-function-declaration]
> >
> > These did not show up in my randconfig tests because randconfig almost
> > always has GPIOLIB selected by some other driver, and I did most
> > of the testing with follow-up patches that address the failures
> > properly.
> >
> > Move the symbol outside of the 'if CONFIG_GPIOLIB' block for the moment
> > to avoid the build failures. It can be moved back and turned off by
> > default once all the driver specific changes are merged.
> >
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: https://lore.kernel.org/oe-kbuild-all/202507261934.yIHeUuEQ-lkp@intel.com/
> > Fixes: 678bae2eaa81 ("gpiolib: make legacy interfaces optional")
> > Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> > ---
> > drivers/gpio/Kconfig | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
>
> This change causes all of the GPIO submenu to show up directly in the
> already way too long 'Device Drivers' menu.
>
> >
> > diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
> > index 8bda3c9d47b4..c48f9badb513 100644
> > --- a/drivers/gpio/Kconfig
> > +++ b/drivers/gpio/Kconfig
> > @@ -12,11 +12,11 @@ menuconfig GPIOLIB
> >
> > If unsure, say N.
> >
> > -if GPIOLIB
> > -
> > config GPIOLIB_LEGACY
> > def_bool y
>
> Perhaps this has to be before "menuconfig GPIOLIB"?
>
Hi Arnd,
This is still broken in next, will you have some time to spend on it
or should I just go with what Rob proposed?
Bart
> >
> > +if GPIOLIB
> > +
> > config GPIOLIB_FASTPATH_LIMIT
> > int "Maximum number of GPIOs for fast path"
> > range 32 512
> > --
> > 2.39.5
> >
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2025-09-01 11:44 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-26 21:10 [PATCH] gpiolib: enable CONFIG_GPIOLIB_LEGACY even for !GPIOLIB Arnd Bergmann
2025-07-27 8:27 ` Bartosz Golaszewski
2025-07-29 10:47 ` Geert Uytterhoeven
2025-07-29 11:57 ` Arnd Bergmann
2025-07-29 12:12 ` Geert Uytterhoeven
2025-07-29 14:11 ` Arnd Bergmann
2025-08-13 22:26 ` Rob Herring
2025-09-01 11:44 ` Bartosz Golaszewski
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).