]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
PCI: qcom: Indicate broken L1SS exit during resume from system suspend
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Tue, 19 May 2026 08:11:22 +0000 (13:41 +0530)
committerBjorn Helgaas <bhelgaas@google.com>
Sat, 23 May 2026 11:54:01 +0000 (06:54 -0500)
Qcom PCIe RCs can successfully exit from L1SS during OS runtime. However,
during system suspend, the Qcom PCIe RC driver may remove all resource
votes and turn off the PHY to maximize power savings.

Consequently, when the host is in system suspend with the link in L1SS and
the endpoint asserts CLKREQ#, the RC driver must restore the PHY and enable
the REFCLK. This recovery process causes the L1SS exit latency time to be
exceeded (roughly L10_REFCLK_ON + T_COMMONMODE). If the RC driver were to
retain all votes during suspend, L1SS exit would succeed without issue but
at the expense of higher power consumption.

When the host fails to move the link from L1SS to L0 within the
L10_REFCLK_ON + T_COMMONMODE time, the endpoint may treat it as a fatal
condition and trigger Link Down (LDn) during resume. This LDn results in a
reset that destroys the internal device state.

To ensure that the client drivers can properly handle this scenario, let
them know about this platform limitation by setting the
'pci_host_bridge::broken_l1ss_resume' flag.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Link: https://patch.msgid.link/20260519-l1ss-fix-v2-3-b2c3a4bdeb15@oss.qualcomm.com
drivers/pci/controller/dwc/pcie-qcom.c

index af6bf5cce65bee0b12ef7a08bfc1121d85b407f9..a0b59b4ef1d2dc49f33cbf278eaa6191254373bd 100644 (file)
@@ -1368,6 +1368,19 @@ static void qcom_pcie_host_post_init(struct dw_pcie_rp *pp)
        struct dw_pcie *pci = to_dw_pcie_from_pp(pp);
        struct qcom_pcie *pcie = to_qcom_pcie(pci);
 
+       /*
+        * During system suspend, the Qcom RC driver may turn off the
+        * analog circuitry of PHY and remove controller votes to save
+        * power. If the link is in L1SS and the endpoint asserts CLKREQ#
+        * to exit L1SS, the time required to wake the system and restore
+        * the PHY/REFCLK may exceed the L1SS exit timing (L10_REFCLK_ON +
+        * T_COMMONMODE), resulting in Link Down (LDn) and a reset of the
+        * endpoint. Set this flag to indicate this limitation to client
+        * drivers so that they can avoid relying on device state being
+        * preserved during system suspend.
+        */
+       pp->bridge->broken_l1ss_resume = true;
+
        if (pcie->cfg->ops->host_post_init)
                pcie->cfg->ops->host_post_init(pcie);
 }