Re: [PATCH net 2/2] dpll: filter pin->dpll_refs by cookie in dpll_pin_on_pin_unregister

From: Jakub Kicinski

Date: Wed May 20 2026 - 22:21:35 EST


This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
dpll: filter pin->dpll_refs by cookie in dpll_pin_on_pin_unregister

This commit fixes a warning triggered when unregistering a pin that is
reachable through multiple parents with different supported DPLL sets. It
filters the DPLL reference iteration by the parent cookie to ensure only the
entries contributed by the specific parent are removed.

> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c
> index 4a058b46c69d4..4779976682fdb 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -1024,8 +1024,14 @@ void dpll_pin_on_pin_unregister(struct dpll_pin *parent, struct dpll_pin *pin,
> mutex_lock(&dpll_lock);
> dpll_pin_delete_ntf(pin);

Does this send a premature deletion notification to userspace when a pin has
multiple parents?

While this patch correctly fixes the kernel-side handling of multiple-parent
pins, it appears the userspace notification lifecycle remains asymmetrical in
this scenario.

Because dpll_pin_delete_ntf(pin) is called unconditionally before removing
the parent or DPLL references, dpll_pin_available(pin) evaluates to true and
the DPLL_CMD_PIN_DELETE_NTF event is broadcasted to userspace.

If a pin is registered via both parent_A and parent_B, unregistering it from
parent_A alone will instruct userspace to tear down its state for the pin,
even though the pin remains fully registered and active via parent_B.

Could this cause desynchronization between kernel and userspace states when a
shared pin is partially unregistered?

> dpll_xa_ref_pin_del(&pin->parent_refs, parent, ops, priv, pin);
> - xa_for_each(&pin->dpll_refs, i, ref)
> + /* pin->dpll_refs is the union over all of pin's parents; only
> + * touch entries actually registered via @parent.
> + */
> + xa_for_each(&pin->dpll_refs, i, ref) {
> + if (!dpll_pin_registration_find(ref, ops, priv, parent))
> + continue;
> __dpll_pin_unregister(ref->dpll, pin, ops, priv, parent);
> + }
> mutex_unlock(&dpll_lock);
> }
> EXPORT_SYMBOL_GPL(dpll_pin_on_pin_unregister);