lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VfFQe3Ce-Si1sax8CCG1-rq+Y=8JhwH=82d3XgytCAmOQ@mail.gmail.com>
Date:   Sat, 13 Aug 2022 00:58:36 +0300
From:   Andy Shevchenko <andy.shevchenko@...il.com>
To:     "H. Peter Anvin" <hpa@...or.com>
Cc:     Christophe Leroy <christophe.leroy@...roup.eu>,
        Linus Walleij <linus.walleij@...aro.org>,
        Bartosz Golaszewski <brgl@...ev.pl>,
        Jonathan Corbet <corbet@....net>,
        Russell King <linux@...linux.org.uk>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
        Arnd Bergmann <arnd@...db.de>,
        "open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>,
        Linux Documentation List <linux-doc@...r.kernel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        linux-arm Mailing List <linux-arm-kernel@...ts.infradead.org>,
        Linux-Arch <linux-arch@...r.kernel.org>
Subject: Re: [PATCH] gpio: Allow user to customise maximum number of GPIOs

On Thu, Aug 11, 2022 at 11:12 PM H. Peter Anvin <hpa@...or.com> wrote:
>
> On August 9, 2022 3:40:38 AM PDT, Christophe Leroy <christophe.leroy@...roup.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?).

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ