[coreboot] [PATCH] v3: fix PCI bus scan / device tree interaction
c-d.hailfinger.devel.2006 at gmx.net
Fri Aug 29 12:30:14 CEST 2008
On 29.08.2008 08:38, Stefan Reinauer wrote:
> Carl-Daniel Hailfinger wrote:
>> Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
> NACK !
>> This patch fixes the dts lookup, BUT it introduces new undesired behaviour:
>> - Only the first bus of a PCI domain is scanned. That's fixable in an
>> obvious way.
The comment in the old code suggests that there can be only one PCI bus
below a PCI domain ("There is only one link on this device, and it is
always link 0"). Is that true? In that case, the new behaviour wouldn't
be undesired, but conform to the spec.
> Please just send that obvious patch and it can be reviewed.
Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006 at gmx.net>
--- corebootv3-pci_scan_bus/device/pci_device.c (Revision 845)
+++ corebootv3-pci_scan_bus/device/pci_device.c (Arbeitskopie)
@@ -1196,8 +1196,16 @@
unsigned int pci_domain_scan_bus(struct device *dev, unsigned int max)
printk(BIOS_SPEW, "pci_domain_scan_bus: calling pci_scan_bus\n");
- /* There is only one link on this device, and it is always link 0. */
- return pci_scan_bus(&dev->link, PCI_DEVFN(0, 0), 0xff, max);
+ /* There is only one link on this device, and it is always link 0.
+ * dev->link for a PCI domain is the domain link.
+ * The child of the domain link is the PCI bus device.
+ * We want to scan the bus link of the PCI bus device.
+ * dev->link.children->link is that PCI bus link.
+ * If there can be multiple PCI buses below a PCI domain, we have to
+ * iterate over the PCI buses in a loop.
+ return pci_scan_bus(&dev->link.children->link, PCI_DEVFN(0, 0),
+ 0xff, max);
More information about the coreboot