> -----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: Eric Dumazet <[email protected]>; Nguyen, Anthony L
> <[email protected]>; Leon Romanovsky <[email protected]>;
> Lobakin, Aleksander <[email protected]>; linux-
> [email protected]; Kitszel, Przemyslaw
> <[email protected]>; Kubalewski, Arkadiusz
> <[email protected]>; [email protected];
> Jakub Kicinski <[email protected]>; Paolo Abeni <[email protected]>;
> Jiri Pirko <[email protected]>; Richard Cochran
> <[email protected]>; Prathosh Satish
> <[email protected]>; Vadim Fedorenko
> <[email protected]>; Mark Bloch <[email protected]>; linux-
> [email protected]; Tariq Toukan <[email protected]>; Andrew Lunn
> <[email protected]>; Jonathan Lemon <[email protected]>;
> Saeed Mahameed <[email protected]>; David S. Miller
> <[email protected]>
> Subject: [Intel-wired-lan] [PATCH net-next v3 7/9] dpll: Add reference
> count tracking support
>
> Add support for the REF_TRACKER infrastructure to the DPLL subsystem.
>
> When enabled, this allows developers to track and debug reference
> counting leaks or imbalances for dpll_device and dpll_pin objects. It
> records stack traces for every get/put operation and exposes this
> information via debugfs at:
> /sys/kernel/debug/ref_tracker/dpll_device_*
> /sys/kernel/debug/ref_tracker/dpll_pin_*
>
> The following API changes are made to support this:
> 1. dpll_device_get() / dpll_device_put() now accept a 'dpll_tracker *'
> (which is a typedef to 'struct ref_tracker *' when enabled, or an
> empty
> struct otherwise).
> 2. dpll_pin_get() / dpll_pin_put() and fwnode_dpll_pin_find()
> similarly
> accept the tracker argument.
> 3. Internal registration structures now hold a tracker to associate
> the
> reference held by the registration with the specific owner.
>
> All existing in-tree drivers (ice, mlx5, ptp_ocp, zl3073x) are updated
> to pass NULL for the new tracker argument, maintaining current
> behavior while enabling future debugging capabilities.
>
> Co-developed-by: Petr Oros <[email protected]>
> Signed-off-by: Petr Oros <[email protected]>
> Signed-off-by: Ivan Vecera <[email protected]>
> ---
> v3:
> * added Kconfig dependency on STACKTRACE_SUPPORT and DEBUG_KERNEL
> ---
> drivers/dpll/Kconfig | 15 +++
> drivers/dpll/dpll_core.c | 98 ++++++++++++++----
> -
> drivers/dpll/dpll_core.h | 5 +
> drivers/dpll/zl3073x/dpll.c | 12 +--
> drivers/net/ethernet/intel/ice/ice_dpll.c | 14 +--
> .../net/ethernet/mellanox/mlx5/core/dpll.c | 13 +--
> drivers/ptp/ptp_ocp.c | 15 +--
> include/linux/dpll.h | 19 +++-
> 8 files changed, 138 insertions(+), 53 deletions(-)
>
> diff --git a/drivers/dpll/Kconfig b/drivers/dpll/Kconfig index
> ade872c915ac6..be98969f040ab 100644
> --- a/drivers/dpll/Kconfig
> +++ b/drivers/dpll/Kconfig
> @@ -8,6 +8,21 @@ menu "DPLL device support"
> config DPLL
> bool
>
> +config DPLL_REFCNT_TRACKER
> + bool "DPLL reference count tracking"
> + depends on DEBUG_KERNEL && STACKTRACE_SUPPORT && DPLL
> + select REF_TRACKER
> + help
> + Enable reference count tracking for DPLL devices and pins.
> + This helps debugging reference leaks and use-after-free bugs
> + by recording stack traces for each get/put operation.
> +
> + The tracking information is exposed via debugfs at:
> + /sys/kernel/debug/ref_tracker/dpll_device_*
> + /sys/kernel/debug/ref_tracker/dpll_pin_*
> +
> + If unsure, say N.
> +
> source "drivers/dpll/zl3073x/Kconfig"
>
> endmenu
> diff --git a/drivers/dpll/dpll_core.c b/drivers/dpll/dpll_core.c index
> 33333bc2f0cc8..52b2398b9f3ec 100644
...
> --
> 2.52.0
Reviewed-by: Aleksandr Loktionov <[email protected]>