Various legacy probing options
I'd like to take the logic that checks whether a bus has already been scanned out of pcibios_scan_root() and push it down into pci_scan_bus{,_parented}().
The trouble is that pci_scan_bus() already has a check for whether a bus has been scanned or not and returns the opposite possibiity (pcibios_scan_root() returns the bus if it exists; pci_scan_bus() returns NULL if that bus already exists).
Most callers of pci_scan_bus() don't even bother to check the return value, so they don't care if this changes. The only caller I can find that actually cares is arch/i386/pci/irq.c:pirq_peer_trick() [can someone check me on this? some of the architectures are a bit strange].
I wonder if this case ever occurs, though. pirq_peer_trick() is called from pcibios_irq_init() which is a subsys_initcall. irq.o is linked after legacy.o, which contains the subsys_initcall pci_legacy_init(), which calls pcibios_fixup_peer_bridges() which already iterates over 0-pcibios_last_bus looking for busses.
Are there really broken PCs out there that will have additional bridges found in the PIRQ tables after pcibios_last_bus?
Signature · 3 lines
"It's not Hollywood. War is real, war is primarily not about defeat or victory, it is about death. I've seen thousands and thousands of dead bodies. Do you think I want to have an academic debate on this subject?" -- Robert Fisk
Hello!
Quoted 2 lines
Are there really broken PCs out there that will have additional bridges found in the PIRQ tables after
pcibios_last_bus?
Probably not, but many of the ancient BIOSes just set the last bus to 0xff.
Have a nice fortnight
Signature · 3 lines
Martin `MJ' Mares <[email protected]> http://atrey.karlin.mff.cuni.cz/~mj/ Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth "Dijkstra probably hates me." -- /usr/src/linux/kernel/sched.c