MLK-16830 PCI: imx: fix boot failulre when the pll is not locked
authorRichard Zhu <hongxing.zhu@nxp.com>
Mon, 14 Jan 2019 10:37:30 +0000 (16:07 +0530)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
Return the error when the pll is not locked.

Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Reviewed-by: Frank Li <frank.li@nxp.com>
rebase on v4.19
Signed-off-by: Vipul Kumar <vipul_kumar@mentor.com>
drivers/pci/controller/dwc/pci-imx6.c

index d5faeda..39f4326 100644 (file)
@@ -788,8 +788,10 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
                        dev_err(dev, "ERROR PM_REQ_CORE_RST is still set.\n");
 
                /* wait for phy pll lock firstly. */
-               if (imx8_pcie_wait_for_phy_pll_lock(imx6_pcie))
+               if (imx8_pcie_wait_for_phy_pll_lock(imx6_pcie)) {
                        ret = -ENODEV;
+                       break;
+               }
 
                /* set up the cpu address offset */
                if (imx6_pcie->cpu_base)
@@ -829,7 +831,8 @@ static int imx6_pcie_deassert_core_reset(struct imx6_pcie *imx6_pcie)
                mdelay(20);
        }
 
-       return ret;
+       if (ret == 0)
+               return ret;
 
 err_ref_clk:
        clk_disable_unprepare(imx6_pcie->pcie_phy);