]> git.ipfire.org Git - people/ms/linux.git/commitdiff
pcie-rockchip-host: try again if training fail.
authorArne Fitzenreiter <arne_f@ipfire.org>
Sat, 5 Feb 2022 15:35:57 +0000 (15:35 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 28 Sep 2022 09:40:03 +0000 (09:40 +0000)
on NanoPi R4S the training of the pcie often fails at first try
so this try again some times.

Signed-off-by: Arne Fitzenreiter <arne_f@ipfire.org>
drivers/pci/controller/pcie-rockchip-host.c

index 7352b5ff8d35981e8b3093f8dbe5e395938db00a..08d97c552886c237033961aa4590d87c89aa9c61 100644 (file)
@@ -962,8 +962,16 @@ static int rockchip_pcie_probe(struct platform_device *pdev)
        }
 
        err = rockchip_pcie_host_init_port(rockchip);
-       if (err)
-               goto err_vpcie;
+       if (err) {
+               dev_err(dev, "failed to init port, try again...\n");
+               err = rockchip_pcie_host_init_port(rockchip);
+               if (err) {
+                       dev_err(dev, "failed to init port, last try in 500ms.\n");
+                       mdelay(500);
+                       err = rockchip_pcie_host_init_port(rockchip);
+                       if (err) goto err_vpcie;
+               }
+       }
 
        err = rockchip_pcie_init_irq_domain(rockchip);
        if (err < 0)