> -----Original Message-----
> From: Intel-wired-lan <[email protected]> On Behalf
> Of Ivan Vecera
> Sent: Friday, January 30, 2026 5:54 PM
> To: [email protected]
> Cc: Lobakin, Aleksander <[email protected]>; Andrew Lunn
> <[email protected]>; Kubalewski, Arkadiusz
> <[email protected]>; David S. Miller
> <[email protected]>; Eric Dumazet <[email protected]>; Jakub
> Kicinski <[email protected]>; Jiri Pirko <[email protected]>; Jonathan
> Lemon <[email protected]>; Leon Romanovsky <[email protected]>;
> Mark Bloch <[email protected]>; Paolo Abeni <[email protected]>;
> Prathosh Satish <[email protected]>; Kitszel, Przemyslaw
> <[email protected]>; Richard Cochran
> <[email protected]>; Saeed Mahameed <[email protected]>; Tariq
> Toukan <[email protected]>; Nguyen, Anthony L
> <[email protected]>; Vadim Fedorenko
> <[email protected]>; [email protected]; linux-
> [email protected]; [email protected]
> Subject: [Intel-wired-lan] [PATCH net-next v3 6/9] dpll: Enhance and
> consolidate reference counting logic
>
> Refactor the reference counting mechanism for DPLL devices and pins to
> improve consistency and prevent potential lifetime issues.
>
> Introduce internal helpers __dpll_{device,pin}_{hold,put}() to
> centralize reference management.
>
> Update the internal XArray reference helpers (dpll_xa_ref_*) to
> automatically grab a reference to the target object when it is added
> to a list, and release it when removed. This ensures that objects
> linked internally (e.g., pins referenced by parent pins) are properly
> kept alive without relying on the caller to manually manage the count.
>
> Consequently, remove the now redundant manual `refcount_inc/dec` calls
> in dpll_pin_on_pin_{,un}register()`, as ownership is now correctly
> handled by the dpll_xa_ref_* functions.
>
> Additionally, ensure that dpll_device_{,un}register()` takes/releases
> a reference to the device, ensuring the device object remains valid
> for the duration of its registration.
>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
> drivers/dpll/dpll_core.c | 74 +++++++++++++++++++++++++++------------
> -
> 1 file changed, 50 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index
> b91f4dc6bb972..33333bc2f0cc8 100644
> --- a/drivers/dpll/dpll_core.c
> +++ b/drivers/dpll/dpll_core.c
> @@ -83,6 +83,45 @@ void dpll_pin_notify(struct dpll_pin *pin, unsigned
> long action)
...
> --
> 2.52.0
Reviewed-by: Aleksandr Loktionov <[email protected]>