aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc/pci-keystone.c
diff options
context:
space:
mode:
authorKishon Vijay Abraham I <kishon@ti.com>2018-10-17 03:40:57 -0400
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>2018-10-17 04:40:56 -0400
commit2433a182ad9c6b1febac75825cbf81f358fec474 (patch)
treef3b8639f05b4352a032bbc0f9cf784c94186105c /drivers/pci/controller/dwc/pci-keystone.c
parent1e10f73e4cb033e73a3f47b0cc6080c0e3cf28f2 (diff)
PCI: keystone: Do not initiate link training multiple times
commit 886bc5ceb5cc3ad4b219502d72 ("PCI: designware: Add generic dw_pcie_wait_for_link()") while adding a generic dw_pcie_wait_for_link() performed a special handling (initiate link training multiple times) for keystone which is not required. This also resulted in unncessarily waiting for more time to establish the link even when no PCI device is connected. Remove it and make it look similar to other dwc based PCIe drivers. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Diffstat (limited to 'drivers/pci/controller/dwc/pci-keystone.c')
-rw-r--r--drivers/pci/controller/dwc/pci-keystone.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/pci/controller/dwc/pci-keystone.c b/drivers/pci/controller/dwc/pci-keystone.c
index afb948372077..aa7e706fc37d 100644
--- a/drivers/pci/controller/dwc/pci-keystone.c
+++ b/drivers/pci/controller/dwc/pci-keystone.c
@@ -87,19 +87,17 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie)
87{ 87{
88 struct dw_pcie *pci = ks_pcie->pci; 88 struct dw_pcie *pci = ks_pcie->pci;
89 struct device *dev = pci->dev; 89 struct device *dev = pci->dev;
90 unsigned int retries;
91 90
92 if (dw_pcie_link_up(pci)) { 91 if (dw_pcie_link_up(pci)) {
93 dev_info(dev, "Link already up\n"); 92 dev_info(dev, "Link already up\n");
94 return 0; 93 return 0;
95 } 94 }
96 95
96 ks_dw_pcie_initiate_link_train(ks_pcie);
97
97 /* check if the link is up or not */ 98 /* check if the link is up or not */
98 for (retries = 0; retries < 5; retries++) { 99 if (!dw_pcie_wait_for_link(pci))
99 ks_dw_pcie_initiate_link_train(ks_pcie); 100 return 0;
100 if (!dw_pcie_wait_for_link(pci))
101 return 0;
102 }
103 101
104 dev_err(dev, "phy link never came up\n"); 102 dev_err(dev, "phy link never came up\n");
105 return -ETIMEDOUT; 103 return -ETIMEDOUT;