NVIDIA: SAUCE: PCI: tegra194: Remove debugfs if link up

BugLink: https://bugs.launchpad.net/bugs/2072591

Issue:
debugfs entry is available only when link state is up.
During shutdown debugfs remove API is called before link state check.
This results in duplicate API invocation during shutdown
sequence resulting in kernel panic.

Fix:
Move debugfs removal API post link state check.

http://nvbugs/4169798

Signed-off-by: Nagarjuna Kristam <nkristam@nvidia.com>
Reviewed-by: Prathamesh Shete <pshete@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Tested-by: Prathamesh Shete <pshete@nvidia.com>
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Acked-by: Jacob Martin <jacob.martin@canonical.com>
Acked-by: Noah Wager <noah.wager@canonical.com>
Signed-off-by: Noah Wager <noah.wager@canonical.com>
This commit is contained in:
Nagarjuna Kristam
2023-07-04 16:34:28 +05:30
committed by Noah Wager
parent d5ea36d92d
commit 05513c1234
+2 -1
View File
@@ -3099,7 +3099,6 @@ static void tegra_pcie_dw_shutdown(struct platform_device *pdev)
struct tegra_pcie_dw *pcie = platform_get_drvdata(pdev);
if (pcie->of_data->mode == DW_PCIE_RC_TYPE) {
debugfs_remove_recursive(pcie->debugfs);
disable_irq(pcie->prsnt_irq);
disable_irq(pcie->pci.pp.irq);
if (IS_ENABLED(CONFIG_PCI_MSI))
@@ -3108,6 +3107,8 @@ static void tegra_pcie_dw_shutdown(struct platform_device *pdev)
return;
if (!pm_runtime_enabled(pcie->dev))
return;
debugfs_remove_recursive(pcie->debugfs);
tegra_pcie_dw_pme_turnoff(pcie);
tegra_pcie_unconfig_controller(pcie);
pm_runtime_put_sync(pcie->dev);