diff options
author | Richard Zhu <hongxing.zhu@nxp.com> | 2017-05-04 14:58:35 +0800 |
---|---|---|
committer | Leonard Crestez <leonard.crestez@nxp.com> | 2018-08-24 12:41:33 +0300 |
commit | 9f4ec877ed8e0b9c79df1abb49fc0cbea501095c (patch) | |
tree | 34bf60a983b85447317f388e87f5980899113c63 /drivers/pci/host/pci-imx6.c | |
parent | ec0fb7de011e6d1570e1a75ff2c900e9c3150562 (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/host/pci-imx6.c')
-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) |