Skip to contentSkip to conversation

PCI: qcom: Advertise hotplug with no command completion support

PATCH Applied Krishna Chaitanya Chundru 5 participants 13 messages Mar 14 – Oct 16

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: qcom: Advertise hotplug with no command completion support

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
 drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
 	dw_pcie_dbi_ro_wr_en(pci);
 
 	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-	val &= ~PCI_EXP_SLTCAP_HPC;
+	val |= PCI_EXP_SLTCAP_NCCS;
 	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
 
 	dw_pcie_dbi_ro_wr_dis(pci);

---
base-commit: 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a
change-id: 20260313-hotplug-4c296595b5b8

Best regards,

Signature · 1 line
Krishna Chaitanya Chundru <[email protected]>
#1 lore raw
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 16 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
 drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 361

Quoted 5 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
 	dw_pcie_dbi_ro_wr_en(pci);
 
 	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-	val &= ~PCI_EXP_SLTCAP_HPC;
+	val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#2 lore raw
Quoted 38 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 18 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
  drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
  	dw_pcie_dbi_ro_wr_en(pci);
 
Quoted 5 lines

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 361

Quoted 3 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
  	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-	val &= ~PCI_EXP_SLTCAP_HPC;
+	val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

- Krishna Chaitanya.

Quoted 2 lines

- Mani

#3 lore raw
Quoted 45 lines · Krishna Chaitanya Chundru
Quoted 31 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 11 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
  drivers/pci/controller/dwc/pcie-qcom.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 11 lines

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 360

Quoted 9 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Quoted 3 lines

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

Are you saying that the RC itself will not generate them based on what happens on the bus, but they can be triggered artificially?

Konrad

#4 lore raw
Quoted 45 lines · Konrad Dybcio
Quoted 44 lines · Krishna Chaitanya Chundru
Quoted 42 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 16 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
   drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 360

Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Quoted 5 lines
Quoted 3 lines

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

Are you saying that the RC itself will not generate them based on what happens on the bus, but they can be triggered artificially?

Yes there are parf registers through which msi's can be triggered artificially.

- Krishna Chaitanya.

Quoted 2 lines

Konrad

#5 lore raw
Quoted 48 lines · Krishna Chaitanya Chundru
Quoted 45 lines · Konrad Dybcio
Quoted 44 lines · Krishna Chaitanya Chundru
Quoted 42 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 16 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
   drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 360

Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

Are you saying that the RC itself will not generate them based on what happens on the bus, but they can be triggered artificially?

Yes there are parf registers through which msi's can be triggered artificially.

As Krishna said, it seems there are ways to *inject* these events through platform specific means (through PARF register space), even if the associated signals are not exposed to the slot. And we might end up using those events at some point.

So it is OK from my opinion to just disable NCCS. But this also warrants a comment in the code.

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
Tested-by Reviewed-by
#6 lore raw
Quoted 58 lines · Manivannan Sadhasivam
Quoted 48 lines · Krishna Chaitanya Chundru
Quoted 45 lines · Konrad Dybcio
Quoted 44 lines · Krishna Chaitanya Chundru
Quoted 42 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 16 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
   drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 360

Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

Are you saying that the RC itself will not generate them based on what happens on the bus, but they can be triggered artificially?

Yes there are parf registers through which msi's can be triggered artificially.

Quoted 7 lines

As Krishna said, it seems there are ways to *inject* these events through platform specific means (through PARF register space), even if the associated signals are not exposed to the slot. And we might end up using those events at some point.

So it is OK from my opinion to just disable NCCS. But this also warrants a comment in the code.

Alright, in any case, this is required for PCIe-over-TBT hotplug without tapping into the "global" irq

and with the comment added:

Konrad

#8 lore raw
In reply to Krishna Chaitanya Chundru
Quoted 11 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

[...]

Applied, thanks!

[1/1] PCI: qcom: Advertise hotplug with no command completion support

      commit: 33a76fc3c3e61386524479b99f35423bd3d9a895

Best regards,

Signature · 1 line
Manivannan Sadhasivam <[email protected]>
#7 lore raw
In reply to Manivannan Sadhasivam
Quoted 58 lines · Manivannan Sadhasivam
Quoted 48 lines · Krishna Chaitanya Chundru
Quoted 45 lines · Konrad Dybcio
Quoted 44 lines · Krishna Chaitanya Chundru
Quoted 42 lines · Manivannan Sadhasivam
Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Just some background: I added commit a54db86ddc153 to disable hotplug for Qcom PCIe Root Ports since we were seeing completion timeouts for hotplug commands and also the PRSNT# signal was not exposed on any of our SoCs. After checking with some internal folks I learned that hotplug functionality was not exercised in Linux. So these facts made me believe that hotplug was not suppored at all.

But it turned out that the Qcom Root Ports support "Data Link Layer State Changed Events" such as DL_Up/Down events.

Quoted 16 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

---
   drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c static void qcom_pcie_clear_hpc(struct dw_pcie *pci) · line 360

Quoted 4 lines
drivers/pci/controller/dwc/pcie-qcom.c +1 -1
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;

Are you sure that this is the only non-supported capability? What about Attention, Presence, Power Fault, MRL etc...?

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

Even though there no signals required for attention, presence etc in the hardware there is a way to generate these MSI's with these bits set through parf, so technically so other co-processor in the system can trigger interrupts.

Are you saying that the RC itself will not generate them based on what happens on the bus, but they can be triggered artificially?

Yes there are parf registers through which msi's can be triggered artificially.

Quoted 8 lines

As Krishna said, it seems there are ways to *inject* these events through platform specific means (through PARF register space), even if the associated signals are not exposed to the slot. And we might end up using those events at some point.

So it is OK from my opinion to just disable NCCS. But this also warrants a comment in the code.

I added the comments and also changed the helper function name while applying.

- Mani

Signature · 1 line
மணிவண்ணன் சதாசிவம்
#9 lore raw
In reply to Krishna Chaitanya Chundru

Hi,

Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Quoted 5 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

I'm a little late to the party, but marking the RC as Hotplus means the bridge is marked as is_pciehp and pci_bridge_d3_possible() returns false.

This means this breaks D3Cold support completely since in __pci_host_common_d3cold_possible() we now check all PCI devices, including bridges, and the RC is not set in D3Hot anymore.

The only way to enable D3Cold is to pass pcie_port_pm=force to allow D3 on all Hotplug bridges. Which may be wrong on TB bridges.

Neil

Quoted 25 lines
---
  drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +1 -2
index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
  	dw_pcie_dbi_ro_wr_en(pci);
 
  	val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-	val &= ~PCI_EXP_SLTCAP_HPC;
+	val |= PCI_EXP_SLTCAP_NCCS;
  	writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
 
  	dw_pcie_dbi_ro_wr_dis(pci);
 
---

base-commit: 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a
change-id: 20260313-hotplug-4c296595b5b8

Best regards,

#10 lore raw
Quoted 19 lines · Neil Armstrong

Hi,

Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Quoted 5 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

Quoted 8 lines

I'm a little late to the party, but marking the RC as Hotplus means the bridge is marked as is_pciehp and pci_bridge_d3_possible() returns false.

This means this breaks D3Cold support completely since in __pci_host_common_d3cold_possible() we now check all PCI devices, including bridges, and the RC is not set in D3Hot anymore.

The only way to enable D3Cold is to pass pcie_port_pm=force to allow D3 on all Hotplug bridges. Which may be wrong on TB bridges.

At a glance, may it be that we should advertise pciehp_is_native=true? (it's currently only a thing in ACPI world)

Konrad

#11 lore raw
In reply to Neil Armstrong
Quoted 22 lines · Neil Armstrong

Hi,

Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Quoted 5 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

I'm a little late to the party, but marking the RC as Hotplus means the bridge is marked as is_pciehp and pci_bridge_d3_possible() returns false.

Quoted 8 lines

This means this breaks D3Cold support completely since in __pci_host_common_d3cold_possible()
we now check all PCI devices, including bridges, and the RC is not set in D3Hot anymore.

The only way to enable D3Cold is to pass pcie_port_pm=force to allow D3 on all Hotplug bridges. Which may be wrong on TB bridges.

Hi Neil,
can you enable hotplug driver and use this patch [1], that should solve the issue.

[1]
https://patch.msgid.link/[email protected]

Quoted 29 lines

Neil

Quoted 26 lines

---
  drivers/pci/controller/dwc/pcie-qcom.c | 2 +-

  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0

index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c +1 -2
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;
       writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
         dw_pcie_dbi_ro_wr_dis(pci);
 
---

base-commit: 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a
change-id: 20260313-hotplug-4c296595b5b8

Best regards,

#12 lore raw

Hi,

Quoted 30 lines · Krishna Chaitanya Chundru
Quoted 27 lines · Neil Armstrong

Hi,

Quoted 10 lines · Krishna Chaitanya Chundru

QCOM PCIe controller advertise hotplug capability in hardware but do not support hotplug command completion. As a result, the PCI core registers the pciehp service and issues hotplug commands that never gets completions, leading to repeated timeout warnings and multi-second delays during boot and suspend/resume.

Commit a54db86ddc153 ("PCI: qcom: Do not advertise hotplug capability for IPs v2.7.0 and v1.9.0") avoided these timeouts by clearing the Hot-Plug Capability bit entirely, which also disabled all hotplug functionality.

Quoted 5 lines

Instead of disabling hotplug, mark these controllers as not supporting command completion by setting the No Command Completed Support (NCCS) bit in the Slot Capabilities register. This prevents the PCI hotplug driver from waiting for commands completion while still allowing hotplug-related functionality such as Data Link Layer state change events.

I'm a little late to the party, but marking the RC as Hotplus means the bridge is marked as is_pciehp and pci_bridge_d3_possible() returns false.

This means this breaks D3Cold support completely since in __pci_host_common_d3cold_possible()
we now check all PCI devices, including bridges, and the RC is not set in D3Hot anymore.

Quoted 8 lines
Quoted 3 lines

The only way to enable D3Cold is to pass pcie_port_pm=force to allow D3 on all Hotplug bridges. Which may be wrong on TB bridges.

Hi Neil,
can you enable hotplug driver and use this patch [1], that should solve the issue.

[1]
https://patch.msgid.link/[email protected]

Thanks this fixes the issue,

Neil

Quoted 31 lines
Quoted 30 lines

Neil

Quoted 26 lines
---
   drivers/pci/controller/dwc/pcie-qcom.c | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/controller/dwc/pcie-qcom.c +0 -0

index 67a16af69ddc75fca1b123e70715e692a91a9135..a2924610f3625f2456a491473c135840e31bafb9 100644

drivers/pci/controller/dwc/pcie-qcom.c +1 -2
@@ -358,7 +358,7 @@ static void qcom_pcie_clear_hpc(struct dw_pcie *pci)
       dw_pcie_dbi_ro_wr_en(pci);
         val = readl(pci->dbi_base + offset + PCI_EXP_SLTCAP);
-    val &= ~PCI_EXP_SLTCAP_HPC;
+    val |= PCI_EXP_SLTCAP_NCCS;
       writel(val, pci->dbi_base + offset + PCI_EXP_SLTCAP);
         dw_pcie_dbi_ro_wr_dis(pci);
 
---

base-commit: 0257f64bdac7fdca30fa3cae0df8b9ecbec7733a
change-id: 20260313-hotplug-4c296595b5b8

Best regards,