[PATCH v4 4/5] PCI: dwc: Rework the error print of dw_pcie_wait_for_link()

Manivannan Sadhasivam via B4 Relay posted 5 patches 2 weeks, 6 days ago
[PATCH v4 4/5] PCI: dwc: Rework the error print of dw_pcie_wait_for_link()
Posted by Manivannan Sadhasivam via B4 Relay 2 weeks, 6 days ago
From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>

If the link fails to come up even after detecting the device on the bus
i.e., if the LTSSM is not in Detect.Quiet and Detect.Active states, then
dw_pcie_wait_for_link() should log it as an error.

So promote dev_info() to dev_err(), reword the error log to make it clear
and also print the LTSSM state to aid debugging.

Tested-by: Richard Zhu <hongxing.zhu@nxp.com>
Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
---
 drivers/pci/controller/dwc/pcie-designware.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c
index f74eae79cca4..2fa9f6ee149e 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -787,7 +787,8 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
 			return -EIO;
 		}
 
-		dev_info(pci->dev, "Phy link never came up\n");
+		dev_err(pci->dev, "Link failed to come up. LTSSM: %s\n",
+			dw_pcie_ltssm_status_string(ltssm));
 		return -ETIMEDOUT;
 	}
 

-- 
2.51.0
Re: [PATCH v4 4/5] PCI: dwc: Rework the error print of dw_pcie_wait_for_link()
Posted by Niklas Cassel 2 weeks, 5 days ago
On Tue, Jan 20, 2026 at 11:17:43PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> 
> If the link fails to come up even after detecting the device on the bus
> i.e., if the LTSSM is not in Detect.Quiet and Detect.Active states, then
> dw_pcie_wait_for_link() should log it as an error.

Nit: maybe you should mention Poll.Active and Poll.Compliance here too?


> 
> So promote dev_info() to dev_err(), reword the error log to make it clear
> and also print the LTSSM state to aid debugging.
> 
> Tested-by: Richard Zhu <hongxing.zhu@nxp.com>
> Tested-by: Vincent Guittot <vincent.guittot@linaro.org>
> Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> ---

Regardless:
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Re: [PATCH v4 4/5] PCI: dwc: Rework the error print of dw_pcie_wait_for_link()
Posted by Manivannan Sadhasivam 2 weeks, 5 days ago
On Wed, Jan 21, 2026 at 09:23:58AM +0100, Niklas Cassel wrote:
> On Tue, Jan 20, 2026 at 11:17:43PM +0530, Manivannan Sadhasivam via B4 Relay wrote:
> > From: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
> > 
> > If the link fails to come up even after detecting the device on the bus
> > i.e., if the LTSSM is not in Detect.Quiet and Detect.Active states, then
> > dw_pcie_wait_for_link() should log it as an error.
> 
> Nit: maybe you should mention Poll.Active and Poll.Compliance here too?
> 

Sure, I missed it. Will ammend it while applying.

- Mani

-- 
மணிவண்ணன் சதாசிவம்