PCI: tegra194: Fix PM error handling in tegra_pcie_config_ep()
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 2 Jun 2022 03:19:08 +0000 (07:19 +0400)
committerBjorn Helgaas <bhelgaas@google.com>
Wed, 8 Jun 2022 21:17:21 +0000 (16:17 -0500)
pm_runtime_enable() will increase power disable depth.  If
dw_pcie_ep_init() fails, we should use pm_runtime_disable() to balance it
with pm_runtime_enable().

Add missing pm_runtime_disable() for tegra_pcie_config_ep().

Fixes: c57247f940e8 ("PCI: tegra: Add support for PCIe endpoint mode in Tegra194")
Link: https://lore.kernel.org/r/20220602031910.55859-1-linmq006@gmail.com
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Vidya Sagar <vidyas@nvidia.com>
drivers/pci/controller/dwc/pcie-tegra194.c

index cc26784901627a23338c415038a2297d356b65c8..d992371a36e6fd3eb366118c2bd66c81165d923a 100644 (file)
@@ -1949,6 +1949,7 @@ static int tegra_pcie_config_ep(struct tegra194_pcie *pcie,
        if (ret) {
                dev_err(dev, "Failed to initialize DWC Endpoint subsystem: %d\n",
                        ret);
+               pm_runtime_disable(dev);
                return ret;
        }