]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
PCI: dwc: Return -ENODEV from dw_pcie_wait_for_link() if device is not found
authorManivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
Tue, 20 Jan 2026 17:47:40 +0000 (23:17 +0530)
committerManivannan Sadhasivam <mani@kernel.org>
Wed, 21 Jan 2026 09:14:51 +0000 (14:44 +0530)
commit1bcf245c837bc66fdaddea222bab9eb5c978a9d7
tree52d7fbc4ba2b8bef95bce899e71285ceddfe8cba
parent68ac85fb42cfeb081cf029acdd8aace55ed375a2
PCI: dwc: Return -ENODEV from dw_pcie_wait_for_link() if device is not found

The dw_pcie_wait_for_link() function waits up to 1 second for the PCIe link
to come up and returns -ETIMEDOUT for all failures without distinguishing
cases where no device is present on the bus. But the callers may want to
just skip the failure if the device is not found on the bus and handle
failure for other reasons.

So after timeout, if the LTSSM is in Detect.Quiet or Detect.Active state,
return -ENODEV to indicate the callers that the device is not found on the
bus and return -ETIMEDOUT otherwise.

Also add kernel doc to document the parameter and return values.

Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@oss.qualcomm.com>
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>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260120-pci-dwc-suspend-rework-v4-1-2f32d5082549@oss.qualcomm.com
drivers/pci/controller/dwc/pcie-designware.c