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.
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 87f2ebc134d6..c2dfadc53d04 100644
--- a/drivers/pci/controller/dwc/pcie-designware.c
+++ b/drivers/pci/controller/dwc/pcie-designware.c
@@ -776,7 +776,8 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci)
return -ENODEV;
}
- 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.48.1
在 2026/01/07 星期三 16:11, Manivannan Sadhasivam via B4 Relay 写道: > 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. LTSSM might still be changing, so not sure how much value it would be to print it at a singal moment, but anyway 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 87f2ebc134d6..c2dfadc53d04 100644 > --- a/drivers/pci/controller/dwc/pcie-designware.c > +++ b/drivers/pci/controller/dwc/pcie-designware.c > @@ -776,7 +776,8 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci) > return -ENODEV; > } > > - 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; > } > >
On Wed, Jan 07, 2026 at 04:38:14PM +0800, Shawn Lin wrote: > 在 2026/01/07 星期三 16:11, Manivannan Sadhasivam via B4 Relay 写道: > > 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. > > LTSSM might still be changing, so not sure how much value it would be > to print it at a singal moment, but anyway > It is very unlikely that the LTSSM would be changing after the 1s timeout. Printing the state will allow debugging the link up failure. - Mani > 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 87f2ebc134d6..c2dfadc53d04 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware.c > > +++ b/drivers/pci/controller/dwc/pcie-designware.c > > @@ -776,7 +776,8 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci) > > return -ENODEV; > > } > > - 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; > > } > > > -- மணிவண்ணன் சதாசிவம்
在 2026/01/07 星期三 17:09, Manivannan Sadhasivam 写道: > On Wed, Jan 07, 2026 at 04:38:14PM +0800, Shawn Lin wrote: >> 在 2026/01/07 星期三 16:11, Manivannan Sadhasivam via B4 Relay 写道: >>> 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. >> >> LTSSM might still be changing, so not sure how much value it would be >> to print it at a singal moment, but anyway >> > > It is very unlikely that the LTSSM would be changing after the 1s timeout. > Printing the state will allow debugging the link up failure. > Most cases, yes. But I saw some reports that the LTSSM is stiling changing between RCVRY_* and CFG_* when supporting customers. Especially a buggy card I remembered, which sends some hot reset immediately after link comes up. If it misses the first 1s wait for link check, then we could see ltssm changing here. But better than nothing, keeps a log here isn't a big deal I think. :) > - Mani > >> 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 87f2ebc134d6..c2dfadc53d04 100644 >>> --- a/drivers/pci/controller/dwc/pcie-designware.c >>> +++ b/drivers/pci/controller/dwc/pcie-designware.c >>> @@ -776,7 +776,8 @@ int dw_pcie_wait_for_link(struct dw_pcie *pci) >>> return -ENODEV; >>> } >>> - 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; >>> } >>> >> >
© 2016 - 2026 Red Hat, Inc.