• Trent Piepho's avatar
    PCI: imx6: Fix link training status detection in link up check · 68bc10bf
    Trent Piepho authored
    This bug was introduced in the interaction for two commits on either
    branch of the merge commit 562df5c8 ("Merge branch
    'pci/host-designware' into next").
    Commit 4d107d3b ("PCI: imx6: Move link up check into
    imx6_pcie_wait_for_link()"), changed imx6_pcie_wait_for_link() to poll
    the link status register directly, checking for link up and not
    training, and made imx6_pcie_link_up() only check the link up bit (once,
    not a polling loop).
    While commit 886bc5ce ("PCI: designware: Add generic
    dw_pcie_wait_for_link()"), replaced the loop in
    imx6_pcie_wait_for_link() with a call to a new dwc core function, which
    polled imx6_pcie_link_up(), which still checked both link up and not
    training in a loop.
    When these two commits were merged, the version of
    imx6_pcie_wait_for_link() from 886bc5ce was kept, which eliminated
    the link training check placed there by 4d107d3b. However, the
    version of imx6_pcie_link_up() from 4d107d3b was kept, which
    eliminated the link training check that had been there and was moved to
    The result was the link training check got lost for the imx6 driver.
    Eliminate imx6_pcie_link_up() so that the default handler,
    dw_pcie_link_up(), is used instead. The default handler has the correct
    code, which checks for link up and also that it still is not training,
    fixing the regression.
    Fixes: 562df5c8 ("Merge branch 'pci/host-designware' into next")
    Signed-off-by: default avatarTrent Piepho <tpiepho@impinj.com>
    [lorenzo.pieralisi@arm.com: rewrote the commit log]
    Signed-off-by: default avatarLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Reviewed-by: Lucas Stach's avatarLucas Stach <l.stach@pengutronix.de>
    Cc: Bjorn Helgaas <bhelgaas@google.com>
    Cc: Joao Pinto <Joao.Pinto@synopsys.com>
    Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
    Cc: Richard Zhu <hongxing.zhu@nxp.com>
pci-imx6.c 26.3 KB