Re: [PATCH 1/6] gpiolib: wait for pending label frees before cleaning up desc_srcu
From: Adrian Ambrozewicz
Date: Fri Oct 16 2026 - 03:51:21 EST
On Mon, Oct 12, 2026 at 08:46:03AM -0700, Paul E. McKenney wrote:
> From an SRCU viewpoint:
>
> Reviewed-by: Paul E. McKenney <paulmck@xxxxxxxxxx>
>
> In this, I am assuming that the comment is correct, and that we only
> need to wait for pending frees, not readers.
Thanks, Paul. The comment holds: desc_srcu is embedded in struct
gpio_device, and every reader reaches it through desc->gdev of a
descriptor in that device's array, which is freed along with it. The
readers (the line info of the character device,
gpiochip_dup_line_label(), debugfs and the gpiod_*() print helpers)
all work on a descriptor or chip they hold a reference to, so none of
them can still be inside a read section when the last reference is
dropped and gpiodev_release() runs. Only the queued label frees can be
left at that point.
Adrian