Skip to content

Commit 8805f32

Browse files
Hans ZhangMani-Sadhasivam
authored andcommitted
PCI: cadence: Fix runtime atomic count underflow
If the call to pci_host_probe() in cdns_pcie_host_setup() fails, PM runtime count is decremented in the error path using pm_runtime_put_sync(). But the runtime count is not incremented by this driver, but only by the callers (cdns_plat_pcie_probe/j721e_pcie_probe). And the callers also decrement the runtime PM count in their error path. So this leads to the below warning from the PM core: "runtime PM usage count underflow!" So fix it by getting rid of pm_runtime_put_sync() in the error path and directly return the errno. Fixes: 49e427e ("Merge branch 'pci/host-probe-refactor'") Signed-off-by: Hans Zhang <[email protected]> Signed-off-by: Manivannan Sadhasivam <[email protected]> Link: https://patch.msgid.link/[email protected]
1 parent 0af2f6b commit 8805f32

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

drivers/pci/controller/cadence/pcie-cadence-host.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -570,14 +570,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc)
570570
if (!bridge->ops)
571571
bridge->ops = &cdns_pcie_host_ops;
572572

573-
ret = pci_host_probe(bridge);
574-
if (ret < 0)
575-
goto err_init;
576-
577-
return 0;
578-
579-
err_init:
580-
pm_runtime_put_sync(dev);
581-
582-
return ret;
573+
return pci_host_probe(bridge);
583574
}

0 commit comments

Comments
 (0)