MLK-16830 PCI: imx: fix boot failulre when the pll is not locked
authorRichard Zhu <hongxing.zhu@nxp.com>
Wed, 15 Nov 2017 09:11:40 +0000 (17:11 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:46:58 +0000 (15:46 -0500)
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>
drivers/pci/host/pci-imx6.c

index 850c8a3..148ff8d 100644 (file)
@@ -759,8 +759,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 (pci_imx_phy_pll_locked(imx6_pcie))
+               if (pci_imx_phy_pll_locked(imx6_pcie)) {
                        ret = -ENODEV;
+                       break;
+               }
 
                /* set up the cpu address offset */
                if (imx6_pcie->cpu_base)
@@ -800,7 +802,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);