Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Oct 2014 18:31:12 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r273282 - head/sys/dev/fdt
Message-ID:  <201410191831.s9JIVCk5091019@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Sun Oct 19 18:31:11 2014
New Revision: 273282
URL: https://svnweb.freebsd.org/changeset/base/273282

Log:
  Fail to probe on simplebus nodes that lack a "ranges" property.
  
  Increasingly, FDT data has the "simple-bus" compatible string on nodes
  that have children, but we wouldn't consider them to be busses.  If the
  node lacks a ranges property then we will fail to attach successfully,
  so fail to probe as well.

Modified:
  head/sys/dev/fdt/simplebus.c

Modified: head/sys/dev/fdt/simplebus.c
==============================================================================
--- head/sys/dev/fdt/simplebus.c	Sun Oct 19 17:55:04 2014	(r273281)
+++ head/sys/dev/fdt/simplebus.c	Sun Oct 19 18:31:11 2014	(r273282)
@@ -133,7 +133,13 @@ simplebus_probe(device_t dev)
 	if (!ofw_bus_status_okay(dev))
 		return (ENXIO);
 
-	if (!ofw_bus_is_compatible(dev, "simple-bus") &&
+	/*
+	 * FDT data puts a "simple-bus" compatible string on many things that
+	 * have children but aren't really busses in our world.  Without a
+	 * ranges property we will fail to attach, so just fail to probe too.
+	 */
+	if (!(ofw_bus_is_compatible(dev, "simple-bus") &&
+	    ofw_bus_has_prop(dev, "ranges")) &&
 	    (ofw_bus_get_type(dev) == NULL || strcmp(ofw_bus_get_type(dev),
 	     "soc") != 0))
 		return (ENXIO);



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