linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Christophe Leroy <christophe.leroy@csgroup.eu>,
	Linus Walleij <linus.walleij@linaro.org>,
	Bartosz Golaszewski <brgl@bgdev.pl>,
	Jonathan Corbet <corbet@lwn.net>,
	Russell King <linux@armlinux.org.uk>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux Documentation List <linux-doc@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
	Linux-Arch <linux-arch@vger.kernel.org>
Subject: Re: [PATCH] gpio: Allow user to customise maximum number of GPIOs
Date: Fri, 12 Aug 2022 16:21:36 -0700	[thread overview]
Message-ID: <B4A6C65C-1480-4D20-9A0C-D97BEABC838F@zytor.com> (raw)
In-Reply-To: <CAHp75VfFQe3Ce-Si1sax8CCG1-rq+Y=8JhwH=82d3XgytCAmOQ@mail.gmail.com>

On August 12, 2022 2:58:36 PM PDT, Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
>On Thu, Aug 11, 2022 at 11:12 PM H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On August 9, 2022 3:40:38 AM PDT, Christophe Leroy <christophe.leroy@csgroup.eu> wrote:
>> >At the time being, the default maximum number of GPIOs is set to 512
>> >and can only get customised via an architecture specific
>> >CONFIG_ARCH_NR_GPIO.
>> >
>> >The maximum number of GPIOs might be dependent on the number of
>> >interface boards and is somewhat independent of architecture.
>> >
>> >Allow the user to select that maximum number outside of any
>> >architecture configuration. To enable that, re-define a
>> >core CONFIG_ARCH_NR_GPIO for architectures which don't already
>> >define one. Guard it with a new hidden CONFIG_ARCH_HAS_NR_GPIO.
>> >
>> >Only two architectures will need CONFIG_ARCH_HAS_NR_GPIO: x86 and arm.
>> >
>> >On arm, do like x86 and set 512 as the default instead of 0, that
>> >allows simplifying the logic in asm-generic/gpio.h
>
>...
>
>> This seems very odd to me. GPIOs can be, and often are, attached to peripheral buses which means that the *same system* can have anything from none to thousands of gpios ..
>
>Basically this setting should give us a *minimum* GPIO lines that are
>present on the system. And that is perfectly SoC dependent. The real
>issue is that the GPIO framework has these global arrays that (still?)
>can't be initialized from the heap due to too early initialization (is
>it the true reason?).
>

Ok that makes more sense... but in that case, it would also be good to reclaim excess storage that turns out to not be needed.

I am a bit skeptical, though – we get basic memory allocation very early.

  reply	other threads:[~2022-08-12 23:26 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-09 10:40 [PATCH] gpio: Allow user to customise maximum number of GPIOs Christophe Leroy
2022-08-11 19:57 ` H. Peter Anvin
2022-08-12 21:58   ` Andy Shevchenko
2022-08-12 23:21     ` H. Peter Anvin [this message]
2022-08-17 17:21   ` Christophe Leroy
2022-08-17 17:46 ` Arnd Bergmann
2022-08-18  6:00   ` Christophe Leroy
2022-08-18  8:25     ` Arnd Bergmann
2022-08-18  9:33 ` Linus Walleij
2022-08-18  9:47   ` Arnd Bergmann
2022-08-18 11:13     ` Linus Walleij
2022-08-18 11:33       ` Arnd Bergmann
2022-08-18 12:25         ` Linus Walleij
2022-08-18 12:46           ` Arnd Bergmann
2022-08-18 13:11             ` Christophe Leroy
2022-08-25 13:36             ` Linus Walleij
2022-08-25 14:00               ` Christophe Leroy
2022-08-26 13:49                 ` Linus Walleij
2022-08-26 15:08                   ` Christophe Leroy
2022-08-26 21:54                     ` Linus Walleij
2022-08-28  9:06                       ` Christophe Leroy
2022-08-28 10:04                         ` Arnd Bergmann
2022-08-30  7:58                           ` Davide Ciminaghi
2022-08-31 13:32                             ` Linus Walleij
2022-08-31 14:12                               ` Davide Ciminaghi
2022-08-31 21:07                                 ` Andy Shevchenko
2022-08-31 21:48                                   ` Davide Ciminaghi
2022-08-30  8:33                           ` Alessandro Rubini
2022-08-30  9:03                             ` Christophe Leroy
2022-08-28 11:35                         ` Linus Walleij

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=B4A6C65C-1480-4D20-9A0C-D97BEABC838F@zytor.com \
    --to=hpa@zytor.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=arnd@arndb.de \
    --cc=bp@alien8.de \
    --cc=brgl@bgdev.pl \
    --cc=christophe.leroy@csgroup.eu \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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).