RE: [Intel-wired-lan] [PATCH net-next v3 6/9] dpll: Enhance and consolidate reference counting logic

From: Loktionov, Aleksandr

Date: Fri Jan 30 2026 - 12:52:13 EST




> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@xxxxxxxxxx> On Behalf
> Of Ivan Vecera
> Sent: Friday, January 30, 2026 5:54 PM
> To: netdev@xxxxxxxxxxxxxxx
> Cc: Lobakin, Aleksander <aleksander.lobakin@xxxxxxxxx>; Andrew Lunn
> <andrew+netdev@xxxxxxx>; Kubalewski, Arkadiusz
> <arkadiusz.kubalewski@xxxxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; Jiri Pirko <jiri@xxxxxxxxxxx>; Jonathan
> Lemon <jonathan.lemon@xxxxxxxxx>; Leon Romanovsky <leon@xxxxxxxxxx>;
> Mark Bloch <mbloch@xxxxxxxxxx>; Paolo Abeni <pabeni@xxxxxxxxxx>;
> Prathosh Satish <Prathosh.Satish@xxxxxxxxxxxxx>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@xxxxxxxxx>; Richard Cochran
> <richardcochran@xxxxxxxxx>; Saeed Mahameed <saeedm@xxxxxxxxxx>; Tariq
> Toukan <tariqt@xxxxxxxxxx>; Nguyen, Anthony L
> <anthony.l.nguyen@xxxxxxxxx>; Vadim Fedorenko
> <vadim.fedorenko@xxxxxxxxx>; intel-wired-lan@xxxxxxxxxxxxxxxx; linux-
> kernel@xxxxxxxxxxxxxxx; linux-rdma@xxxxxxxxxxxxxxx
> 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 <ivecera@xxxxxxxxxx>
> ---
> 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 <aleksandr.loktionov@xxxxxxxxx>