Print an error and correct pci scan limits. Skip sb700 ISA DMA init if needed.
[coreboot.git] / src / devices / pci_device.c
index 4a9fa1466e7713ce1696842827b909a938fda950..16e8d3f20304bd784cae96df4ff54449a906e9bd 100644 (file)
@@ -1019,6 +1019,14 @@ unsigned int pci_scan_bus(struct bus *bus,
        printk(BIOS_DEBUG, "PCI: pci_scan_bus for bus %02x\n", bus->secondary);
 #endif
 
+       // Maximum sane devfn is 0xFF
+       if (max_devfn > 0xff) {
+               printk(BIOS_ERR, "PCI: pci_scan_bus limits devfn %x - devfn %x\n",
+                          min_devfn, max_devfn );
+               printk(BIOS_ERR, "PCI: pci_scan_bus upper limit too big. Using 0xff.\n");
+               max_devfn=0xff;
+       }
+
        old_devices = bus->children;
        bus->children = NULL;