Skip to contentSkip to conversation

FAILED: patch "[PATCH] PCI: qcom-ep: Deinitialize endpoint on remove" failed to apply to 6.6-stable tree

PATCH Sasha Levin 1 participant 1 message Nov 7

Subsystems (5)
lore
Share & tools
lore

Sasha Levin

author maintainer
#0 lore raw

The patch below does not apply to the 6.6-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.

To reproduce the conflict and resubmit, you may use the following commands:

git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.6.y
git checkout FETCH_HEAD
git cherry-pick -x ed1d71e41c7b2e755e0ef8e9af9cab9b6b185c4b
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '[email protected]' --subject-prefix 'PATCH 6.6.y' 'HEAD^..'

Thanks,
Sasha

------------------ original commit in Linus's tree ------------------

From ed1d71e41c7b2e755e0ef8e9af9cab9b6b185c4b Mon Sep 17 00:00:00 2001
From: Guangshuo Li <[email protected]>
Date: Wed, 16 Sep 2026 17:01:26 +0800
Subject: [PATCH] PCI: qcom-ep: Deinitialize endpoint on remove

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")
---
 drivers/pci/controller/dwc/pcie-qcom-ep.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/pci/controller/dwc/pcie-qcom-ep.c +2 -0
index 56184e6ca6e69..28949386b0e87 100644
@@ -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);
 }
Signature · 1 line
2.53.0