Re: [PATCH net v3 00/14] net: pse-pd: assorted lifetime and error-path fixes

From: Kory Maincent

Date: Wed Nov 04 2026 - 10:38:48 EST


> Fixes for the PSE core and the pd692x0 driver, found while working on
> the PSE controller teardown. Most of them are about what happens when a
> controller unbinds or fails to register.
>
> 1 The kfifo is too small: podl-pse-regulator and any controller with
> 0 or 1 lines cannot register.
> 2 Removes two checks that can never be true. Not a fix; it makes 3
> smaller.
> 3 A module reference leaks when reading the port state fails.
> 4 A failed IRQ request stays in pcdev->irq, so unregister disables a
> line another device may own.
> 5 The notification worker can read a PHY that was already freed.
> 6 Setting a power limit checks the PI state without the lock.
> 7 A power domain shared by two controllers is freed when the one that
> created it unbinds, or when registration fails part way.
> 8 Unregister frees the PI array before it stops the IRQ handler and
> the notification worker. The worker can also be queued again
> during unregister.
> 9 Unregister frees the PI array while a lookup can still find the
> controller.
> 10 The PI regulator ops can run after the PI array is freed.
> 11 A failed registration leaks the kfifo.
> 12 A shared power domain's supply handle goes stale when the controller
> that created it unbinds.
> 13 pd692x0 leaks its manager power budget when probe fails.
> 14 pd692x0 crashes on a manager supply that is not resolved yet.
>
> Some patches need earlier ones: 7 needs the locked check from 6, 10 to
> 12 build on 7 to 9, and 14 relies on 13 to give back a budget that was
> already reserved.
>
> Testing: every patch builds on its own with W=1 and is checkpatch
> clean. 1, 5, 7, 10 and 12 were tested in QEMU (arm64, KASAN, lockdep,
> kmemleak) with test-only fake PSE controllers: without the patch, the
> failure in its commit message shows up; with the whole series, the
> tests are clean, except for the older lockdep report and the reserved
> budget, both listed below. For v3, the whole series and 7 on its own
> were tested again. The other patches were found by code inspection and
> are build-tested only.

It would be nice to test these fixes on real hardware, to validate that
it still works without issues.
I will try to do it when I find time but if someone does it beforehand I
would be thankful.

--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com