[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vdgezkc3-4a0jSG7qkvL31xdde8jSwTtWqct3dUVBm8=w@mail.gmail.com>
Date: Tue, 29 Apr 2025 23:23:55 +0300
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Thomas Richard <thomas.richard@...tlin.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>, Bartosz Golaszewski <brgl@...ev.pl>,
Geert Uytterhoeven <geert+renesas@...der.be>, Kees Cook <kees@...nel.org>,
Andy Shevchenko <andy@...nel.org>, linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
thomas.petazzoni@...tlin.com, DanieleCleri@...on.eu, GaryWang@...on.com.tw,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH v4 09/12] gpio: aggregator: handle runtime registration of
gpio_desc in gpiochip_fwd
On Tue, Apr 29, 2025 at 5:08 PM Thomas Richard
<thomas.richard@...tlin.com> wrote:
>
> Add request() callback to check if the GPIO descriptor was well registered
> in the gpiochip_fwd before to use it. This is done to handle the case
to use --> using
> where GPIO descriptor is added at runtime in the forwarder.
>
> If at least one GPIO descriptor was not added before the forwarder
> registration, we assume the forwarder can sleep as if a GPIO is added at
> runtime it may sleep.
...
> + /*
> + * get_direction() is called during gpiochip registration, return input
> + * direction if there is no descriptor for the line
Missing period at the end.
> + */
...
> - if (fwd->descs[offset])
> + if (test_and_set_bit(offset, fwd->valid_mask))
> return -EEXIST;
Here you should add the entire conditional and not in the one of the
previous patches.
...
> + /*
> + * Some gpio_desc were not registered. They will be registered at runtime
> + * but we have to suppose they can sleep.
> + */
> + if (bitmap_full(fwd->valid_mask, chip->ngpio))
I think I don't get this check. The bitmap_full() returns true if and
only if _all_ bits up to the nbits are set. In accordance with the
comment it seems you wanted something different (an opposite?).
> + chip->can_sleep = true;
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists