PCI root bridge detection fix [7/9]
RFC PATCH 1/1 PCI root bridge detection fix [7/9]
This patch prevents the root bridge drivers from using the legacy API. It also updates the PCI<->PCI bridge driver to better coexist with the legacy code.
Signed-off-by Adam Belay <[email protected]>
drivers/pci/bus/pci-bridge.c +4 -0
@@ -128,6 +128,10 @@if (dev->hdr_type !=PCI_HEADER_TYPE_BRIDGE )return -ENODEV ; +/* don't bind to devices controlled by legacy code */ +if (dev->subordinate) +return -ENODEV ; + bus =ppb_detect_bus (dev);if (!bus)return -ENODEV ;
drivers/pci/bus/probe.c +4 -1
@@ -395,6 +395,7 @@struct pci_bus *__devinit pci_scan_bus_parented (struct device *parent,int bus,struct pci_ops *ops,void *sysdata) {int error; +unsigned int devfn;struct pci_bus *b;struct device *dev;
@@ -440,7 +441,9 @@/* Create legacy_io and legacy_mem files for this bus */ pci_create_legacy_files (b); - b->subordinate =pci_scan_child_bus (b); +/* Go find them, Rover! */ +for (devfn =0 ; devfn <0x100 ; devfn +=8 ) +pci_scan_slot (b, devfn);return b;