From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E2BEB347DD; Mon, 23 Jun 2025 13:43:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750686203; cv=none; b=Botn8Xid/wbBuRM8OTy8G0kmJBJvfw4+e8/RrcmSYPs3c5BsU77eQ5nKgx1EqXXDCnzhGvIvSqBAcphXCG5sP5tSGAmCGVbHZB8HWhV5fIeEXYB9GBAt/Z/TcpsST9zpxcrGFvAhbHzcDobiuK/F3dR599QsW5q6EeKMr4VidOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1750686203; c=relaxed/simple; bh=A0ELTNKqMW5UqSFV3d3VRX0TbaVupzE8TTzG4za9BYs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qS03dTtOIwecUCIsTEo/IN+1ZoJYmOs3tRiyu1GYPw7MdgPPQhm/4Y171Nbo6iCv7eF1E8YN33QueOHHjG8gJM9Ism5bMv/cYzygMQAeY/bGU2Y74btDTcY4ZSMHJ7LGf1Me36OOICdo5c5YPN4WreXGDb1pC9BywpiUWfNDegQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Ar5VdFqL; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="Ar5VdFqL" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 77F7DC4CEEA; Mon, 23 Jun 2025 13:43:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1750686202; bh=A0ELTNKqMW5UqSFV3d3VRX0TbaVupzE8TTzG4za9BYs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ar5VdFqLzBzYrhulBDWwfO4enJGyMMz+cYKMirXOpo0qz62sl0vTxZPmn0zthln40 GPTnZPwVSxe6AP7CxiX9QXfAK7i6qKXajf46beSiuH+4r8v/I3sPclAbPLjcY2OIIa EIiOdUxiXTn4OUYkroMBQv2vHGwbEcZfVCCdFmXI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Hans Zhang <18255117159@163.com>, Manivannan Sadhasivam , Sasha Levin Subject: [PATCH 5.15 104/411] PCI: cadence: Fix runtime atomic count underflow Date: Mon, 23 Jun 2025 15:04:08 +0200 Message-ID: <20250623130636.129943125@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250623130632.993849527@linuxfoundation.org> References: <20250623130632.993849527@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans Zhang <18255117159@163.com> [ 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 Link: https://patch.msgid.link/20250419133058.162048-1-18255117159@163.com Signed-off-by: Sasha Levin --- drivers/pci/controller/cadence/pcie-cadence-host.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 4d8d15ac51ef4..c29176bdecd19 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -548,14 +548,5 @@ int cdns_pcie_host_setup(struct cdns_pcie_rc *rc) if (!bridge->ops) bridge->ops = &cdns_pcie_host_ops; - ret = pci_host_probe(bridge); - if (ret < 0) - goto err_init; - - return 0; - - err_init: - pm_runtime_put_sync(dev); - - return ret; + return pci_host_probe(bridge); } -- 2.39.5