[U-Boot] [PATCH 1/1] pci: pci_mvebu: fix bus enumeration if some buses have empty slots

Marek BehĂșn marek.behun at nic.cz
Tue May 14 14:58:59 UTC 2019


The ofdata_to_platdata method for this driver returns -ENODEV if link is
down for a given bus, for example if there is no device in the slot.
This causes the uclass_{first,next}_device to return NULL for this bus
in pci-uclass.c:pci_init, which of course stops probing of buses which
come after.

So if the slot on the first bus is empty on Turris Omnia, and the slot
on second bus has a device connected, the device is not probed in
U-Boot. On Turris Omnia the PCIe devices have to be probed in U-Boot to
work correctly in Linux. Therefore we need this fix.

Signed-off-by: Marek BehĂșn <marek.behun at nic.cz>
Cc: Stefan Roese <sr at denx.de>
Cc: Anton Schubert <anton.schubert at gmx.de>
Cc: Dirk Eibach <dirk.eibach at gdsys.cc>
Cc: Mario Six <mario.six at gdsys.cc>
Cc: Chris Packham <chris.packham at alliedtelesis.co.nz>
Cc: Phil Sutter <phil at nwl.cc>
Cc: VlaoMao <vlaomao at gmail.com>
---
 drivers/pci/pci_mvebu.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/pci/pci_mvebu.c b/drivers/pci/pci_mvebu.c
index 653f445a0f..7ec6a2be27 100644
--- a/drivers/pci/pci_mvebu.c
+++ b/drivers/pci/pci_mvebu.c
@@ -436,7 +436,6 @@ static int mvebu_pcie_ofdata_to_platdata(struct udevice *dev)
 	/* Check link and skip ports that have no link */
 	if (!mvebu_pcie_link_up(pcie)) {
 		debug("%s: %s - down\n", __func__, pcie->name);
-		ret = -ENODEV;
 		goto err;
 	}
 
-- 
2.21.0



More information about the U-Boot mailing list