Re: [PATCH v8 0/8] gpiolib: fix chip removal with lines still requested from user space
From: Bartosz Golaszewski
Date: Tue Nov 24 2026 - 09:02:28 EST
On Tue, Nov 24, 2026 at 11:57:07AM +0200, Andy Shevchenko wrote:
> On Tue, Nov 24, 2026 at 11:20:31AM +0200, Adrian Ambrozewicz wrote:
> > Removing a GPIO chip while user space holds a line request, as when a
> > hot-pluggable GPIO controller goes away, leaks the line labels (patch 2)
> > and IRQ names (patch 5), frees IRQs twice (patches 3, 7 and 8) and lets
> > a blocked read() stall the removal (patch 4). Patch 1 makes
> > gpiodev_release() wait for pending label frees; without it,
> > cleanup_srcu_struct() can warn, more often with patch 2.
> >
> > Patch 7 also affects in-kernel users: their remaining IRQs are freed
> > after the chip pointer is cleared, when gpiod_*() calls fail. Patch 6
> > drops edge events whose line read fails instead of reporting an edge.
> >
> > User-visible change: a read() blocked when the chip is removed returns
> > the queued events, then fails with -ENODEV.
> >
> > For stable: patch 2 needs 1, 5 needs 3, 7 needs 3, 5 and 6, and 8
> > needs 7; patches 3, 5 and 7 fix a 6.13 commit also in 6.12.y, patch 8 a
> > 6.19 commit; patch 4 applies to 6.12.y.
> >
> > Tested under QEMU (x86_64, arm64) with gpio-sim, a shared gpio-sim line
> > and a test chip on the hierarchical irqchip, with lockdep, kmemleak and
> > KASAN.
> >
> > Prepared with Cursor and Claude Code, using Claude, which helped analyse
> > the bugs, write the reproducers and draft the patches; I reviewed and
> > tested every change.
>
> Bart, this series seems contain two parts, core and cdev fixes, the first
> (core) fixes are being reproduced and tested in our lab and they are pretty
> much ready to go. Can we at least have them (patches 1 & 2) pulled rather
> sooner, please?
>
Do you have any comments on patches 7/8 or 8/8? This version has no
sashiko comments and only the two final patches are not reviewed. If you
can leave an R-b under them, I'm fine taking all of them now.
Bart