Преглед на файлове

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>
Kishon Vijay Abraham I преди 6 години
родител
ревизия
2433a182ad
променени са 1 файла, в които са добавени 4 реда и са изтрити 6 реда
  1. 4 6
      drivers/pci/controller/dwc/pci-keystone.c

+ 4 - 6
drivers/pci/controller/dwc/pci-keystone.c

@@ -87,19 +87,17 @@ static int ks_pcie_establish_link(struct keystone_pcie *ks_pcie)
 {
 {
 	struct dw_pcie *pci = ks_pcie->pci;
 	struct dw_pcie *pci = ks_pcie->pci;
 	struct device *dev = pci->dev;
 	struct device *dev = pci->dev;
-	unsigned int retries;
 
 
 	if (dw_pcie_link_up(pci)) {
 	if (dw_pcie_link_up(pci)) {
 		dev_info(dev, "Link already up\n");
 		dev_info(dev, "Link already up\n");
 		return 0;
 		return 0;
 	}
 	}
 
 
+	ks_dw_pcie_initiate_link_train(ks_pcie);
+
 	/* check if the link is up or not */
 	/* check if the link is up or not */
-	for (retries = 0; retries < 5; retries++) {
-		ks_dw_pcie_initiate_link_train(ks_pcie);
-		if (!dw_pcie_wait_for_link(pci))
-			return 0;
-	}
+	if (!dw_pcie_wait_for_link(pci))
+		return 0;
 
 
 	dev_err(dev, "phy link never came up\n");
 	dev_err(dev, "phy link never came up\n");
 	return -ETIMEDOUT;
 	return -ETIMEDOUT;