Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Sep 2013 15:10:11 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r255615 - head/sys/powerpc/ofw
Message-ID:  <201309161510.r8GFABav024780@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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));
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201309161510.r8GFABav024780>