Add a loader tunable to use only device tree-provided PCI devices. This is
needed on some more fragile systems to avoid machine checks when blindly probing the PCI bus. Also reduce ofw_pcibus's priority slightly so that it can be overridden. Approved by: re (gjb)
This commit is contained in:
parent
1aff10b99e
commit
1c5fc51cdf
@ -101,6 +101,9 @@ DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcibus_driver, pci_devclass, 0, 0);
|
||||
MODULE_VERSION(ofw_pcibus, 1);
|
||||
MODULE_DEPEND(ofw_pcibus, pci, 1, 1, 1);
|
||||
|
||||
static int ofw_devices_only = 0;
|
||||
TUNABLE_INT("hw.pci.ofw_devices_only", &ofw_devices_only);
|
||||
|
||||
static int
|
||||
ofw_pcibus_probe(device_t dev)
|
||||
{
|
||||
@ -109,7 +112,7 @@ ofw_pcibus_probe(device_t dev)
|
||||
return (ENXIO);
|
||||
device_set_desc(dev, "OFW PCI bus");
|
||||
|
||||
return (0);
|
||||
return (BUS_PROBE_DEFAULT);
|
||||
}
|
||||
|
||||
static int
|
||||
@ -137,7 +140,8 @@ ofw_pcibus_attach(device_t dev)
|
||||
* functions on multi-function cards.
|
||||
*/
|
||||
|
||||
ofw_pcibus_enum_bus(dev, domain, busno);
|
||||
if (!ofw_devices_only)
|
||||
ofw_pcibus_enum_bus(dev, domain, busno);
|
||||
|
||||
return (bus_generic_attach(dev));
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user