[RFC PATCH 1/1] PCI: imx6: Fix device probe without link

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>

If there is no link up during probe -TIMEDOUT will be propagated up and
probing finally fails with -110.
This is contradicts to what commit 886a9c134755 ("PCI: dwc: Move link
handling into common code") says.

Fixes: 886a9c134755 ("PCI: dwc: Move link handling into common code")
Signed-off-by: Alexander Stein <alexander.stein@xxxxxxxxxxxxxxx>
---
These are the kernel messages from an imx8mx based board. Linux is
v5.15-rc3.

imx6q-pcie 33c00000.pcie: host bridge /soc@0/pcie@33c00000 ranges:
imx6q-pcie 33c00000.pcie:   No bus range found for /soc@0/pcie@33c00000, using [bus 00-ff]
imx6q-pcie 33c00000.pcie:       IO 0x0027f80000..0x0027f8ffff -> 0x0000000000
imx6q-pcie 33c00000.pcie:      MEM 0x0020000000..0x0027efffff -> 0x0020000000
imx6q-pcie 33c00000.pcie: invalid resource
imx6q-pcie 33c00000.pcie: iATU unroll: enabled
imx6q-pcie 33c00000.pcie: Detected iATU regions: 4 outbound, 4 inbound
imx6q-pcie 33c00000.pcie: Phy link never came up
imx6q-pcie: probe of 33c00000.pcie failed with error -110

The old code before 886a9c134755 ignored the return code of
imx6_pcie_establish_link() (now imx6_pcie_start_link()) during host_init. Since
that commit the return value of start_link() causes dw_pcie_host_init() to
fail.
This is an RFC as I'm unsure what is the correct behavior and with this
change the dev_info() in imx6_pcie_resume_noirq() is dead code.

 drivers/pci/controller/dwc/pci-imx6.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 80fc98acf097..b45affeb23f5 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -780,8 +780,10 @@ static int imx6_pcie_start_link(struct dw_pcie *pci)
 	imx6_pcie_ltssm_enable(dev);
 
 	ret = dw_pcie_wait_for_link(pci);
-	if (ret)
+	if (ret) {
+		ret = 0;
 		goto err_reset_phy;
+	}
 
 	if (pci->link_gen == 2) {
 		/* Allow Gen2 mode after the link is up. */
-- 
2.25.1




[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux