RE: [Intel-wired-lan] [PATCH net-next v3 6/9] dpll: Enhance and consolidate reference counting logic
From: Loktionov, Aleksandr <hidden>
Date: 2026-01-30 17:51:34
Also in:
intel-wired-lan, linux-rdma, lkml
quoted hunk ↗ jump to hunk
-----Original Message----- From: Intel-wired-lan <redacted> On Behalf Of Ivan Vecera Sent: Friday, January 30, 2026 5:54 PM To: netdev@vger.kernel.org Cc: Lobakin, Aleksander <aleksander.lobakin@intel.com>; Andrew Lunn [off-list ref]; Kubalewski, Arkadiusz [off-list ref]; David S. Miller [off-list ref]; Eric Dumazet [off-list ref]; Jakub Kicinski [off-list ref]; Jiri Pirko [off-list ref]; Jonathan Lemon [off-list ref]; Leon Romanovsky [off-list ref]; Mark Bloch [off-list ref]; Paolo Abeni [off-list ref]; Prathosh Satish [off-list ref]; Kitszel, Przemyslaw [off-list ref]; Richard Cochran [off-list ref]; Saeed Mahameed [off-list ref]; Tariq Toukan [off-list ref]; Nguyen, Anthony L [off-list ref]; Vadim Fedorenko [off-list ref]; intel-wired-lan@lists.osuosl.org; linux- kernel@vger.kernel.org; linux-rdma@vger.kernel.org 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@redhat.com> --- 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 indexb91f4dc6bb972..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, unsignedlong action)
...
-- 2.52.0
Reviewed-by: Aleksandr Loktionov <redacted>