PCI: designware: Add generic dw_pcie_wait_for_link()
authorJoao Pinto <Joao.Pinto@synopsys.com>
Thu, 10 Mar 2016 20:44:35 +0000 (14:44 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Tue, 15 Mar 2016 13:50:45 +0000 (08:50 -0500)
commit886bc5ceb5cc3ad4b219502d72b277e3c3255a32
tree2648e30863433834dd7df7411f677f1a8c7888f1
parentc1678ffcdea25afe4fbbebfab13d65a7db5458fb
PCI: designware: Add generic dw_pcie_wait_for_link()

Several DesignWare-based drivers (dra7xx, exynos, imx6, keystone, qcom, and
spear13xx) had similar loops waiting for the link to come up.

Add a generic dw_pcie_wait_for_link() for use by all these drivers so the
waiting is done consistently, e.g., always using usleep_range() rather than
mdelay() and using similar timeouts and retry counts.

Note that this changes the Keystone link training/wait for link strategy,
so we initiate link training, then wait longer for the link to come up
before re-initiating link training.

[bhelgaas: changelog, split into its own patch, update pci-keystone.c, pcie-qcom.c]
Signed-off-by: Joao Pinto <jpinto@synopsys.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Acked-by: Pratyush Anand <pratyush.anand@gmail.com>
drivers/pci/host/pci-dra7xx.c
drivers/pci/host/pci-exynos.c
drivers/pci/host/pci-imx6.c
drivers/pci/host/pci-keystone.c
drivers/pci/host/pcie-designware.c
drivers/pci/host/pcie-designware.h
drivers/pci/host/pcie-qcom.c
drivers/pci/host/pcie-spear13xx.c