Closed stefano-garzarella closed 6 years ago
Unfortunately this does not work. The idea is that some of the bridges could have overlapping bus values, so before visiting the secondary buses all of the bridges have to be disabled.
What you could do is move do_block_pci_bridges into do_setup_pci, and then do a second pci_foreach that allocates bus numbers and calls do_setup_pci recursively. The second call can be skipped if there are no bridges.
The simple though not super-efficient way to do this is with a variable like bridges_left
. Another crazy idea, on top of this one, is that while the bridges are blocked you could use PCI_SECONDARY_BUS
in the configuration space to store the device/function of the next bridge, in a sort of linked list. That would avoid the second pci_foreach
completely.
Thanks for the explanation!
Sorry, but I was confused because I didn't see that pci_foreach()
uses the bus
global variable.
So, if I understood correctly, to block a bridge is enough to set PCI_SUBORDINATE_BUS
to 0. Is it correct?
... and SECONDARY_BUS to nonzero.
Hi Paolo, I close this pull request and I'll open a new one with the implementation that you suggested.
In order to reduce the boot time, we can reduce the pci_foreach() calls, aggregating the steps in a single function.
Signed-off-by: Stefano Garzarella sgarzare@redhat.com