From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1794063555; b=Utx0PL3ekF2ZnOx4dAji2mPVRm87Q4/unWhurOwDH1/s8tB+6tZ7I0Zlevg9LGuyL/MA NMRUY9Uy/F4A9dsbLCAlDypKOJADUBEnWDp/RBZQnDDe7GONPg45vaI+0YUfw1BY1c7uU KeqxXifEty2TRhqu5UlqR7CRhy/g7Ew9k0PnwQQxXY/jaUHOA8Fzijdwm6mP/3+n8vrYl rBBhESyOg3y/YSfSi+OfOwO4gCWXAc3DJZhzc1fsiP7Txi4Ram2cpRr9jxmYUXG780Wj6 wnnnrCz0yOynrOgejKmFabwjnd2XU++qlpajTQEPP3eqAJpVo71VSmmOjJrLdKO9osA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1794063555; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=XirS6bQ6jx3usc7Gn1OuuG+lbu1VGH2uaDsWpr19plM=; b=0CFgQzLuVUMFH+zzkxTcw1lqStf1IpWerJqZpsoear5nxiDZ9i6Jpp0bFqOXg+AiZN9L g4n7H4yoW+CMlTs/WoT5bAYuJUah+2jHajMM012v4HmrIYLDEDAAOtjgRTSCgbRNRbEw7 ztcYISQ4BhzsCVi6879f9bGQJssaKTEWJHcsEiOtysjNC/9FmQxswQMswVgSO3p6IzRvN MboSzGA2vDEGMABy8MOswzY+s5qcaiQTrrm3r8OQQ/MeJ/Bs78naz8Ui56GR7OMsrb3Rj n/jDq+auX8bPK2/V1qNqQITuhpLWvasuce9qywq7PA9+T58lgPPB4xKsWEbsa1i7Ojg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="o/excsH9"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8ED206082BCF; Sat, 7 Nov 2026 14:59:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=o/excsH9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 390A51F008AB; Sat, 7 Nov 2026 14:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1794063555; bh=XirS6bQ6jx3usc7Gn1OuuG+lbu1VGH2uaDsWpr19plM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=o/excsH9WMRZ0XXyWSjDRJnlE2CE517/YLcplQthyW3QTMI9V5fOonutumAXOm3Sr urMImpKNeiuJ1e2atE2dGolKNqsDmCyTcxyiKzQCLfaBeg2U9SlHdluzUK4d83FOXf osrJkARv1diH7KeZnCYrhiGfjd/NDV0NeNyUwkzc= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Manivannan Sadhasivam , Bjorn Helgaas , Sasha Levin Subject: [PATCH 6.18 690/869] PCI: qcom-ep: Deinitialize endpoint on remove Date: Sat, 7 Nov 2026 08:56:12 -0500 Message-ID: <20261107134916.411901638@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261107134852.069646174@linuxfoundation.org> References: <20261107134852.069646174@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li [ Upstream commit ed1d71e41c7b2e755e0ef8e9af9cab9b6b185c4b ] qcom_pcie_ep_probe() initializes the DesignWare PCIe endpoint with dw_pcie_ep_init(). The probe failure paths call dw_pcie_ep_deinit() to release the corresponding endpoint resources, but the remove path does not perform the matching teardown after a successful probe. As a result, resources initialized by the DesignWare endpoint core can remain allocated when the endpoint controller is removed. Notify endpoint functions about EPC deinitialization and call dw_pcie_ep_deinit() before disabling the controller resources. Keep the existing early return when the link is already disabled since Qualcomm endpoint controllers depend on the host refclk for hardware cleanup. This issue was found by manual code inspection. Fixes: f55fee56a631 ("PCI: qcom-ep: Add Qualcomm PCIe Endpoint controller driver") Signed-off-by: Guangshuo Li Signed-off-by: Manivannan Sadhasivam Signed-off-by: Bjorn Helgaas Cc: stable@vger.kernel.org Link: https://patch.msgid.link/20260916090126.2963064-1-lgs201920130244@gmail.com Signed-off-by: Sasha Levin --- drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-qcom-ep.c b/drivers/pci/controller/dwc/pcie-qcom-ep.c index f1bc0ac81a928..72bb2a2dd238e 100644 --- a/drivers/pci/controller/dwc/pcie-qcom-ep.c +++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c @@ -920,6 +920,8 @@ static void qcom_pcie_ep_remove(struct platform_device *pdev) if (pcie_ep->link_status == QCOM_PCIE_EP_LINK_DISABLED) return; + pci_epc_deinit_notify(pcie_ep->pci.ep.epc); + dw_pcie_ep_deinit(&pcie_ep->pci.ep); qcom_pcie_disable_resources(pcie_ep); } -- 2.53.0