* [PATCH] PCI: qcom-ep: deinitialize endpoint on remove
@ 2026-09-16 9:01 Guangshuo Li
2026-10-14 12:39 ` Manivannan Sadhasivam
0 siblings, 1 reply; 2+ messages in thread
From: Guangshuo Li @ 2026-09-16 9:01 UTC (permalink / raw)
To: Manivannan Sadhasivam, Lorenzo Pieralisi,
Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas,
Siddartha Mohanadoss, linux-arm-msm, linux-pci, linux-kernel
Cc: Guangshuo Li, stable
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")
Cc: stable@vger.kernel.org
Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
---
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 56184e6ca6e6..28949386b0e8 100644
--- a/drivers/pci/controller/dwc/pcie-qcom-ep.c
+++ b/drivers/pci/controller/dwc/pcie-qcom-ep.c
@@ -944,6 +944,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.43.0
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] PCI: qcom-ep: deinitialize endpoint on remove
2026-09-16 9:01 [PATCH] PCI: qcom-ep: deinitialize endpoint on remove Guangshuo Li
@ 2026-10-14 12:39 ` Manivannan Sadhasivam
0 siblings, 0 replies; 2+ messages in thread
From: Manivannan Sadhasivam @ 2026-10-14 12:39 UTC (permalink / raw)
To: Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring,
Bjorn Helgaas, Siddartha Mohanadoss, linux-arm-msm, linux-pci,
linux-kernel, Guangshuo Li
Cc: stable
On Wed, 16 Sep 2026 17:01:26 +0800, Guangshuo Li wrote:
> PCI: qcom-ep: deinitialize endpoint on remove
Applied, thanks!
[1/1] PCI: qcom-ep: deinitialize endpoint on remove
commit: 817c16e46609d60c22679d9145a39e28b1f6e164
Best regards,
--
மணிவண்ணன் சதாசிவம்
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-14 12:39 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-16 9:01 [PATCH] PCI: qcom-ep: deinitialize endpoint on remove Guangshuo Li
2026-10-14 12:39 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®