diff options
author | Lucas Stach <dev@lynxeye.de> | 2015-04-03 14:27:30 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-04-13 08:34:28 +0200 |
commit | da440ab85970108761a090f676b1ad48ed3cfade (patch) | |
tree | 998eb50ec86c6d7ef5c32aa68e30bc071d98260b /drivers | |
parent | 394d4acb8dc3e1c32cd3ff02684628c14157de0a (diff) | |
download | barebox-da440ab85970108761a090f676b1ad48ed3cfade.tar.gz barebox-da440ab85970108761a090f676b1ad48ed3cfade.tar.xz |
pci: make sure to activate devices on the root bus
Commit b8a1bb1dd215 (pci: defer device registration until after bridge setup)
changed the activation order of devices, so that bridges above the devices could
be configured properly before activating the devices below. This commit failed
to acknowledge that there may be devices located directly on the root bus without
any bridge in between and so those devices would never get enabled.
Signed-off-by: Lucas Stach <dev@lynxeye.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/pci/pci.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1f5dc78b3c..2762511cbb 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -348,6 +348,12 @@ unsigned int pci_scan_bus(struct pci_bus *bus) dev->rom_address = (l == 0xffffffff) ? 0 : l; setup_device(dev, 6); + /* + * If this device is on the root bus, there is no bridge + * to configure, so we can activate it right away. + */ + if (!bus->parent_bus) + pci_register_device(dev); break; case PCI_HEADER_TYPE_BRIDGE: setup_device(dev, 2); @@ -356,6 +362,7 @@ unsigned int pci_scan_bus(struct pci_bus *bus) /* inherit parent properties */ child_bus->host = bus->host; child_bus->ops = bus->host->pci_ops; + child_bus->parent_bus = bus; child_bus->resource[PCI_BUS_RESOURCE_MEM] = bus->resource[PCI_BUS_RESOURCE_MEM]; child_bus->resource[PCI_BUS_RESOURCE_MEM_PREF] = |