Skip to content

Commit 5859c92

Browse files
dinghaoliuLorenzo Pieralisi
authored andcommitted
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/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>
1 parent 10739e2 commit 5859c92

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
@@ -1645,7 +1645,7 @@ static void pex_ep_event_pex_rst_deassert(struct tegra_pcie_dw *pcie)
16451645
if (pcie->ep_state == EP_STATE_ENABLED)
16461646
return;
16471647

1648-
ret = pm_runtime_get_sync(dev);
1648+
ret = pm_runtime_resume_and_get(dev);
16491649
if (ret < 0) {
16501650
dev_err(dev, "Failed to get runtime sync for PCIe dev: %d\n",
16511651
ret);

0 commit comments

Comments
 (0)