Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

PCI: dwc: Fail dw_pcie_host_init() if dw_pcie_wait_for_link() returns -ETIMEDOUT

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@oss.qualcomm.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
Link: https://patch.msgid.link/20260120-pci-dwc-suspend-rework-v4-5-2f32d5082549@oss.qualcomm.com

authored by

Manivannan Sadhasivam and committed by
Manivannan Sadhasivam
86cbb7a8 d266f63b

+7 -2
+7 -2
drivers/pci/controller/dwc/pcie-designware-host.c
··· 675 675 goto err_remove_edma; 676 676 } 677 677 678 - /* Ignore errors, the link may come up later */ 679 - dw_pcie_wait_for_link(pci); 678 + /* 679 + * Only fail on timeout error. Other errors indicate the device may 680 + * become available later, so continue without failing. 681 + */ 682 + ret = dw_pcie_wait_for_link(pci); 683 + if (ret == -ETIMEDOUT) 684 + goto err_stop_link; 680 685 681 686 ret = pci_host_probe(bridge); 682 687 if (ret)