Currently the bios goes into an endless loop if more than 255 PCI buses are requested.
Change that to panic which is preferred in this case.
Signed-off-by: Marcel Apfelbaum marcel@redhat.com ---
Hi,
I am well aware that this is not a common scenario, but the bug was found and maybe it deserves a little attention.
I opted for using panic because I saw it used for other scenarios where the bios is out of resources.
Another way to look at this would be to *stop* registering buses over 255 and loose some of the devices, but bring the system up.
Thanks, Marcel
src/fw/pciinit.c | 3 +++ 1 file changed, 3 insertions(+)
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index c31c2fa..5da6cf6 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -469,6 +469,9 @@ pci_bios_init_bus_rec(int bus, u8 *pci_bus)
u8 secbus = pci_config_readb(bdf, PCI_SECONDARY_BUS); (*pci_bus)++; + if (!(*pci_bus)) { + panic("PCI: out of bus numbers!\n"); + } if (*pci_bus != secbus) { dprintf(1, "PCI: secondary bus = 0x%x -> 0x%x\n", secbus, *pci_bus);