svn commit: r255615 - head/sys/powerpc/ofw

Nathan Whitehorn nwhitehorn at FreeBSD.org
Mon Sep 16 15:10:12 UTC 2013


Author: nwhitehorn
Date: Mon Sep 16 15:10:11 2013
New Revision: 255615
URL: http://svnweb.freebsd.org/changeset/base/255615

Log:
  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)

Modified:
  head/sys/powerpc/ofw/ofw_pcibus.c

Modified: head/sys/powerpc/ofw/ofw_pcibus.c
==============================================================================
--- head/sys/powerpc/ofw/ofw_pcibus.c	Mon Sep 16 14:32:56 2013	(r255614)
+++ head/sys/powerpc/ofw/ofw_pcibus.c	Mon Sep 16 15:10:11 2013	(r255615)
@@ -101,6 +101,9 @@ DRIVER_MODULE(ofw_pcibus, pcib, ofw_pcib
 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));
 }


More information about the svn-src-all mailing list