Re: [PATCH 2/2] gpio: shared: fix lockdep false positive by removing unneeded lock

From: Linus Walleij

Date: Mon May 25 2026 - 09:33:06 EST


On Fri, May 22, 2026 at 11:12 AM Bartosz Golaszewski
<bartosz.golaszewski@xxxxxxxxxxxxxxxx> wrote:

> By the time gpio_device_teardown_shared() is called, the parent device
> is gone from the global list of GPIO devices and all outstanding SRCU
> read-side critical sections have completed. That means that no
> concurrent gpio_find_and_request() can call
> gpio_shared_add_proxy_lookup() for this device at this time. There's
> also no risk of the parent device being re-bound to the driver before
> the unbinding completes (including the child devices).
>
> Lockdep produces a false-positive report about a possible circular
> dependency as it doesn't know the ordering guarantee. Not taking the
> ref->lock in gpio_device_teardown_shared() silences it and is safe to do.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: ea513dd3c066 ("gpio: shared: make locking more fine-grained")
> Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@xxxxxxxxxxxxxxxx>

Reviewed-by: Linus Walleij <linusw@xxxxxxxxxx>

Yours,
Linus Walleij