lkml.org 
[lkml]   [2022]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] gpio: Allow user to customise maximum number of GPIOs
On Thu, Aug 18, 2022 at 11:33 AM Linus Walleij <linus.walleij@linaro.org> wrote:
>
> The per-arch GPIO number only exist for one reason: embedded
> GPIOs (think SoC:s) that refer to fixed numbers in numberspace in
> the board support code. This makes it necessary to allocate
> descriptors up front in some compiled-in GPIO chips.

As I understood, the problem that Christophe ran into is that the
dynamic registration of additional gpio chips is broken because
it unregisters the chip if the number space is exhausted:

base = gpiochip_find_base(gc->ngpio);
if (base < 0) {
ret = base;
spin_unlock_irqrestore(&gpio_lock, flags);
goto err_free_label;
}

From the git history, it looks like this error was never handled gracefully
even if the intention was to keep going without a number assignment,
so there are probably other bugs one runs into after changing this.

Arnd

\
 
 \ /
  Last update: 2022-08-18 11:49    [W:0.222 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site