[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20260120-pci-dwc-suspend-rework-v4-5-2f32d5082549@oss.qualcomm.com>
Date: Tue, 20 Jan 2026 23:17:44 +0530
From: Manivannan Sadhasivam via B4 Relay <devnull+manivannan.sadhasivam.oss.qualcomm.com@...nel.org>
To: Jingoo Han <jingoohan1@...il.com>,
Manivannan Sadhasivam <mani@...nel.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kwilczynski@...nel.org>,
Rob Herring <robh@...nel.org>, Bjorn Helgaas <bhelgaas@...gle.com>
Cc: linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org,
vincent.guittot@...aro.org, zhangsenchuan@...incomputing.com,
Shawn Lin <shawn.lin@...k-chips.com>, Niklas Cassel <cassel@...nel.org>,
Richard Zhu <hongxing.zhu@....com>,
Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
Subject: [PATCH v4 5/5] PCI: dwc: Fail dw_pcie_host_init() if
dw_pcie_wait_for_link() returns -ETIMEDOUT
From: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
The dw_pcie_wait_for_link() API now distinguishes link failures more
precisely:
-ENODEV: Device not found on the bus.
-EIO: Device found but inactive.
-ETIMEDOUT: Link failed to come up.
Out of these three errors, only -ETIMEDOUT represents a definitive link
failure since it signals that something is wrong with the link. For the
other two errors, there is a possibility that the link might come up later.
So fail dw_pcie_host_init() if -ETIMEDOUT is returned and skip the failure
otherwise.
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@....qualcomm.com>
---
drivers/pci/controller/dwc/pcie-designware-host.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c
index fad0cbedefbc..a72406ef7e26 100644
--- a/drivers/pci/controller/dwc/pcie-designware-host.c
+++ b/drivers/pci/controller/dwc/pcie-designware-host.c
@@ -675,8 +675,13 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp)
goto err_remove_edma;
}
- /* Ignore errors, the link may come up later */
- dw_pcie_wait_for_link(pci);
+ /*
+ * Only fail on timeout error. Other errors indicate the device may
+ * become available later, so continue without failing.
+ */
+ ret = dw_pcie_wait_for_link(pci);
+ if (ret == -ETIMEDOUT)
+ goto err_stop_link;
ret = pci_host_probe(bridge);
if (ret)
--
2.51.0
Powered by blists - more mailing lists