Re: [PATCH] gpiolib: Use srcu_barrier() instead of synchronize_srcu() in gpiodev_release()
From: Adrian Ambrozewicz
Date: Fri Nov 27 2026 - 02:09:38 EST
On Fri, Nov 27, 2026 at 10:31:01AM +0800, Zqiang wrote:
> The gpio_desc_label object are freed asynchronously via call_srcu() on
> gdev->desc_srcu (see desc_set_label()). to drain these pending SRCU
> callbacks before cleanup the SRCU structure, gpiodev_release() currently
> calls synchronize_srcu(&gdev->desc_srcu).
[...]
> /* Call pending kfree()s for descriptor labels. */
> - synchronize_srcu(&gdev->desc_srcu);
> + srcu_barrier(&gdev->desc_srcu);
> cleanup_srcu_struct(&gdev->desc_srcu);
Hi Zqiang,
Bartosz already has this exact change in gpio/for-current, applied on
2026-11-24 as commit c901e8fddd3a ("gpiolib: wait for pending label
frees before cleaning up desc_srcu"):
https://git.kernel.org/brgl/c/c901e8fddd3a23353bb12c9d93b9a5fc482ac8f5
It carries Fixes: a86d27693066 and Cc: stable.
Thanks,
Adrian