]> git.baikalelectronics.ru Git - kernel.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 Aug 2022 12:23:40 +0000 (14:23 +0200)
[ Upstream commit 1732fe4cfc58cd8b4a2e44a53e5498b3095fd86d ]

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: ae0487c2a0af ("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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/dwc/pcie-tegra194.c

index 9049769130819bfd7f4ddd5b7e99e739963f3c31..98da2578e4dbfd607f9f91beb9d2b7590c3b33a4 100644 (file)
@@ -1951,6 +1951,7 @@ static int tegra_pcie_config_ep(struct tegra_pcie_dw *pcie,
        if (ret) {
                dev_err(dev, "Failed to initialize DWC Endpoint subsystem: %d\n",
                        ret);
+               pm_runtime_disable(dev);
                return ret;
        }