aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDinghao Liu <[email protected]>2021-04-08 15:26:58 +0800
committerLorenzo Pieralisi <[email protected]>2021-04-08 18:10:35 +0100
commit5859c926d1f052ee61b5815b14658875c14f6243 (patch)
tree490e0ce687f89d64a10fc59237f005157ecb020e
parent10739e2a5e83ecac6a7d2422369c5fe8a1a72b04 (diff)
PCI: tegra: Fix runtime PM imbalance in pex_ep_event_pex_rst_deassert()
pm_runtime_get_sync() will increase the runtime PM counter even it returns an error. Thus a pairing decrement is needed to prevent refcount leak. Fix this by replacing this API with pm_runtime_resume_and_get(), which will not change the runtime PM counter on error. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dinghao Liu <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Acked-by: Thierry Reding <[email protected]>
-rw-r--r--drivers/pci/controller/dwc/pcie-tegra194.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c
index 18acd48e8e9b..9b6799258fa4 100644
--- a/drivers/pci/controller/dwc/pcie-tegra194.c
+++ b/drivers/pci/controller/dwc/pcie-tegra194.c
@@ -1645,7 +1645,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
if (pcie->ep_state == EP_STATE_ENABLED)
return;
- ret = pm_runtime_get_sync(dev);
+ ret = pm_runtime_resume_and_get(dev);
if (ret < 0) {
dev_err(dev, "Failed to get runtime sync for PCIe dev: %d\n",
ret);