]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
dpll: Add reference count tracking support
authorIvan Vecera <ivecera@redhat.com>
Tue, 3 Feb 2026 17:40:00 +0000 (18:40 +0100)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 5 Feb 2026 14:57:46 +0000 (15:57 +0100)
commit3c0da1030c58b0f1ee4d8ef4722466f8ce734a53
treef5d235e4e6c1db8a45cb280d6e215337d83a5afd
parent729f5e0153bda8c0423fb7c5795865b6b77ca050
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.

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Co-developed-by: Petr Oros <poros@redhat.com>
Signed-off-by: Petr Oros <poros@redhat.com>
Signed-off-by: Ivan Vecera <ivecera@redhat.com>
Reviewed-by: Arkadiusz Kubalewski <arkadiusz.kubalewski@intel.com>
Link: https://patch.msgid.link/20260203174002.705176-8-ivecera@redhat.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/dpll/Kconfig
drivers/dpll/dpll_core.c
drivers/dpll/dpll_core.h
drivers/dpll/zl3073x/dpll.c
drivers/net/ethernet/intel/ice/ice_dpll.c
drivers/net/ethernet/mellanox/mlx5/core/dpll.c
drivers/ptp/ptp_ocp.c
include/linux/dpll.h