PCI: imx6: Fix device probe without link
Subsystems (4)
RFC PATCH 1/1 PCI: imx6: Fix device probe without link
From: Alexander Stein <[email protected]>
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 <[email protected]>
---
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(-)
drivers/pci/controller/dwc/pci-imx6.c +3 -1
@@ -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. */
Signature · 1 line
2.25.1