]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: cadence: Fix runtime atomic count underflow
authorHans Zhang <18255117159@163.com>
Sat, 19 Apr 2025 13:30:58 +0000 (21:30 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:16 +0000 (11:05 +0100)
commit3e7061f62bd70fa98db80f18dbfeb23fbe6048ee
tree3823007d3aa360f03ed11b21d541acd687a74906
parent19f0d83e1450a1a7587822589ccd6bde279999a6
PCI: cadence: Fix runtime atomic count underflow

[ Upstream commit 8805f32a96d3b97cef07999fa6f52112678f7e65 ]

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: 49e427e6bdd1 ("Merge branch 'pci/host-probe-refactor'")
Signed-off-by: Hans Zhang <18255117159@163.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://patch.msgid.link/20250419133058.162048-1-18255117159@163.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/cadence/pcie-cadence-host.c