]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
dpll: send delete notification before unregister in on-pin rollback
authorGrzegorz Nitka <grzegorz.nitka@intel.com>
Sun, 7 Jun 2026 18:30:36 +0000 (20:30 +0200)
committerJakub Kicinski <kuba@kernel.org>
Sat, 13 Jun 2026 20:24:32 +0000 (13:24 -0700)
The rollback path in dpll_pin_on_pin_register() called
__dpll_pin_unregister() before dpll_pin_delete_ntf(). When the
unregister dropped the pin's last DPLL reference it cleared the
DPLL_REGISTERED mark in dpll_pin_xa, so the subsequent
dpll_pin_event_send() failed dpll_pin_available() and aborted with
-ENODEV. As a result userspace was never notified of the rollback
deletion and remained out of sync with the kernel.

Send the delete notification first, matching the order used by
dpll_pin_unregister() and dpll_pin_on_pin_unregister().

Fixes: 9d71b54b65b1 ("dpll: netlink: Add DPLL framework base functions")
Signed-off-by: Grzegorz Nitka <grzegorz.nitka@intel.com>
Link: https://patch.msgid.link/20260607183045.1213735-5-grzegorz.nitka@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/dpll/dpll_core.c

index cea7e2be2cbcdf2e8efb4e708d97b7ebb9ab604d..80195f3a84f3800cc7aeb39dc259c05218923c44 100644 (file)
@@ -1007,9 +1007,9 @@ int dpll_pin_on_pin_register(struct dpll_pin *parent, struct dpll_pin *pin,
 dpll_unregister:
        xa_for_each(&parent->dpll_refs, i, ref)
                if (i < stop) {
+                       dpll_pin_delete_ntf(pin);
                        __dpll_pin_unregister(ref->dpll, pin, ops, priv,
                                              parent);
-                       dpll_pin_delete_ntf(pin);
                }
        dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin);
 unlock: