linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1)
@ 2022-08-29 16:15 Christophe Leroy
  2022-08-29 16:15 ` [PATCH v1 1/8] gpio: aggregator: Stop using ARCH_NR_GPIOS Christophe Leroy
                   ` (8 more replies)
  0 siblings, 9 replies; 23+ messages in thread
From: Christophe Leroy @ 2022-08-29 16:15 UTC (permalink / raw)
  To: Linus Walleij, Bartosz Golaszewski, Geert Uytterhoeven, Keerthy,
	Russell King, Arnd Bergmann, Jonathan Corbet, Thomas Gleixner,
	Ingo Molnar, Borislav Petkov, Dave Hansen, H. Peter Anvin,
	Catalin Marinas, Will Deacon
  Cc: Christophe Leroy, linux-kernel, linux-gpio, linux-arm-kernel,
	linux-arch, linux-doc, x86

Since commit 14e85c0e69d5 ("gpio: remove gpio_descs global array")
there is no limitation on the number of GPIOs that can be allocated
in the system since the allocation is fully dynamic.

ARCH_NR_GPIOS is today only used in order to provide downwards
gpiobase allocation from that value, while static allocation is
performed upwards from 0. However that has the disadvantage of
limiting the number of GPIOs that can be registered in the system.

To overcome this limitation without requiring each and every
platform to provide its 'best-guess' maximum number, rework the
allocation to allocate from 256 upwards, allowing approx 2 millions
of GPIOs.

In the meantime, add a warning for drivers how are still doing
static allocation, so that in the future the static allocation gets
removed completely and dynamic allocation can start at base 0.

Christophe Leroy (8):
  gpio: aggregator: Stop using ARCH_NR_GPIOS
  gpio: davinci: Stop using ARCH_NR_GPIOS
  gpiolib: Warn on drivers still using static gpiobase allocation
  gpiolib: Get rid of ARCH_NR_GPIOS
  Documentation: gpio: Remove text about ARCH_NR_GPIOS
  x86: Remove CONFIG_ARCH_NR_GPIO
  arm: Remove CONFIG_ARCH_NR_GPIO
  arm64: Remove CONFIG_ARCH_NR_GPIO

 Documentation/driver-api/gpio/legacy.rst |  5 ---
 arch/arm/Kconfig                         | 21 ---------
 arch/arm/include/asm/gpio.h              |  1 -
 arch/arm64/Kconfig                       | 12 ------
 arch/x86/Kconfig                         |  5 ---
 drivers/gpio/gpio-aggregator.c           |  8 ++--
 drivers/gpio/gpio-davinci.c              |  3 --
 drivers/gpio/gpio-sta2x11.c              |  5 +--
 drivers/gpio/gpiolib.c                   | 13 +++---
 include/asm-generic/gpio.h               | 55 +++++++++---------------
 10 files changed, 36 insertions(+), 92 deletions(-)

-- 
2.37.1


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2022-09-02 12:01 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-29 16:15 [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1) Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 1/8] gpio: aggregator: Stop using ARCH_NR_GPIOS Christophe Leroy
2022-08-30  7:51   ` Geert Uytterhoeven
2022-08-29 16:15 ` [PATCH v1 2/8] gpio: davinci: " Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 3/8] gpiolib: Warn on drivers still using static gpiobase allocation Christophe Leroy
2022-08-30 20:14   ` Andy Shevchenko
2022-08-31  5:39     ` Christophe Leroy
2022-08-31  8:00       ` Geert Uytterhoeven
2022-08-29 16:15 ` [PATCH v1 4/8] gpiolib: Get rid of ARCH_NR_GPIOS Christophe Leroy
2022-08-30 20:18   ` Andy Shevchenko
2022-08-31  5:49     ` Christophe Leroy
2022-08-31 20:55       ` Arnd Bergmann
2022-09-02 10:21         ` Christophe Leroy
2022-09-02 10:52         ` Andy Shevchenko
2022-09-02 11:02           ` Geert Uytterhoeven
2022-09-02 11:39           ` Nuno Sá
2022-09-02 12:00           ` Arnd Bergmann
2022-08-29 16:15 ` [PATCH v1 5/8] Documentation: gpio: Remove text about ARCH_NR_GPIOS Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 6/8] x86: Remove CONFIG_ARCH_NR_GPIO Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 7/8] arm: " Christophe Leroy
2022-08-29 16:15 ` [PATCH v1 8/8] arm64: " Christophe Leroy
2022-08-30 20:20 ` [PATCH v1 0/8] gpio: Get rid of ARCH_NR_GPIOS (v1) Andy Shevchenko
2022-08-30 20:21   ` Andy Shevchenko

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