Patchwork [PATCHv5,16/20] PCI: mobiveil: Add link up condition check

login
register
mail settings
Submitter Zhiqiang Hou
Date April 12, 2019, 8:36 a.m.
Message ID <20190412083635.33626-17-Zhiqiang.Hou@nxp.com>
Download mbox | patch
Permalink /patch/771349/
State New
Headers show

Comments

Zhiqiang Hou - April 12, 2019, 8:36 a.m.
From: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>


Avoid to issue CFG transactions to link partner when the PCIe
link is not up.

Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>

---
V5:
 - Corrected the subject.

 drivers/pci/controller/pcie-mobiveil.c | 4 ++++
 1 file changed, 4 insertions(+)

-- 
2.17.1

Patch

diff --git a/drivers/pci/controller/pcie-mobiveil.c b/drivers/pci/controller/pcie-mobiveil.c

index 621852078caf..1ee3ea2570c0 100644

--- a/drivers/pci/controller/pcie-mobiveil.c

+++ b/drivers/pci/controller/pcie-mobiveil.c

@@ -283,6 +283,10 @@  static bool mobiveil_pcie_valid_device(struct pci_bus *bus, unsigned int devfn)

 {
 	struct mobiveil_pcie *pcie = bus->sysdata;
 
+	/* If there is no link, then there is no device */

+	if (bus->number > pcie->root_bus_nr && !mobiveil_pcie_link_up(pcie))

+		return false;

+

 	/* Only one device down on each root port */
 	if ((bus->number == pcie->root_bus_nr) && (devfn > 0))
 		return false;