Le 05/04/2025 à 16:54, Hans Zhang a écrit :
When CONFIG_PCIEASPM is disabled, debugfs entries are not created, but
tegra_pcie_dw_remove() and tegra_pcie_dw_shutdown() unconditionally call
debugfs_remove_recursive(), leading to potential NULL pointer operations.
Introduce deinit_debugfs() to wrap debugfs_remove_recursive(), which is
stubbed for !CONFIG_PCIEASPM. Use this function during removal/shutdown to
ensure debugfs cleanup only occurs when entries were initialized.
This prevents kernel warnings and instability when ASPM support is
disabled.
Could you elaborate?
debugfs_remove_recursive() ends either to:
static inline void debugfs_remove(struct dentry *dentry)
{ }
if CONFIG_DEBUG_FS is not set,
or
to a function which starts with:
if (IS_ERR_OR_NULL(dentry))
return;
if it is set.
So what does this new deinit_debugfs() add?
Which NULL pointer are you seeing?
Did you actually manage to trigger it?