diff options
author | Richard Zhu <hongxing.zhu@nxp.com> | 2017-05-04 14:58:35 +0800 |
---|---|---|
committer | Anson Huang <Anson.Huang@nxp.com> | 2017-06-09 22:20:11 +0800 |
commit | e841dcac5e02d06e552a865a5f49e1cb349d380f (patch) | |
tree | c4fdb20f269f4c0842e92d395e391c15afd8c8ac /drivers/pci | |
parent | 3dbe0d66bc3fdd2adff354c6333a0087d63b0a38 (diff) |
MLK-14796 PCI: imx: kernel panic when reboot ep board
pp->ops is not assigned properly, thus there
would be kernel panic when reboot ep board.
Initialized pp->ops in ep initializatione,
fix this issue.
don't call dw_pcie_wait_for_link because
the usleep is used in it.
Signed-off-by: Richard Zhu <hongxing.zhu@nxp.com>
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-imx6.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/pci/host/pci-imx6.c b/drivers/pci/host/pci-imx6.c index b0b369e1c0fe..bbd3a286673b 100644 --- a/drivers/pci/host/pci-imx6.c +++ b/drivers/pci/host/pci-imx6.c @@ -634,17 +634,25 @@ static void imx6_pcie_init_phy(struct imx6_pcie *imx6_pcie) static int imx6_pcie_wait_for_link(struct imx6_pcie *imx6_pcie) { + int count = 20000; struct pcie_port *pp = &imx6_pcie->pp; struct device *dev = pp->dev; /* check if the link is up or not */ - if (!dw_pcie_wait_for_link(pp)) - return 0; - dev_dbg(dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n", - dw_pcie_readl_rc(pp, PCIE_PHY_DEBUG_R0), - dw_pcie_readl_rc(pp, PCIE_PHY_DEBUG_R1)); - return -ETIMEDOUT; + while (!dw_pcie_link_up(pp)) { + udelay(10); + if (--count) + continue; + + dev_err(pp->dev, "phy link never came up\n"); + dev_dbg(dev, "DEBUG_R0: 0x%08x, DEBUG_R1: 0x%08x\n", + dw_pcie_readl_rc(pp, PCIE_PHY_DEBUG_R0), + dw_pcie_readl_rc(pp, PCIE_PHY_DEBUG_R1)); + return -ETIMEDOUT; + } + + return 0; } static int imx6_pcie_wait_for_speed_change(struct imx6_pcie *imx6_pcie) @@ -1410,6 +1418,7 @@ static int __init imx6_pcie_probe(struct platform_device *pdev) } pp->mem_base = pp->mem->start; + pp->ops = &imx6_pcie_host_ops; /* enable disp_mix power domain */ if (imx6_pcie->variant == IMX7D) |