Skip to content

Commit 4800a98

Browse files
dinghaoliugregkh
authored andcommitted
PCI: tegra: Fix runtime PM imbalance in pex_ep_event_pex_rst_deassert()
[ Upstream commit 5859c92 ] 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/20210408072700.15791-1-dinghao.liu@zju.edu.cn Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> Acked-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent dd6ba89 commit 4800a98

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/pci/controller/dwc/pcie-tegra194.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1660,7 +1660,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
16601660
if (pcie->ep_state == EP_STATE_ENABLED)
16611661
return;
16621662

1663-
ret = pm_runtime_get_sync(dev);
1663+
ret = pm_runtime_resume_and_get(dev);
16641664
if (ret < 0) {
16651665
dev_err(dev, "Failed to get runtime sync for PCIe dev: %d\n",
16661666
ret);

0 commit comments

Comments
 (0)