mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 04:44:45 +01:00
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>
28 lines
679 B
Text
28 lines
679 B
Text
# SPDX-License-Identifier: GPL-2.0-only
|
|
#
|
|
# Generic DPLL drivers configuration
|
|
#
|
|
|
|
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
|