summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Mustacchi <rm@fingolfin.org>2020-03-04 18:23:40 +0000
committerRobert Mustacchi <rm@fingolfin.org>2020-03-07 09:16:20 +0000
commit6de7dd38d5e1d12791b18f60b9cad431c7d4b419 (patch)
tree7e5465103be79a7d2b051599d8dd1344d2cc8591
parentac2f5fbefc05314fcd97b03f2338b39e6efe643f (diff)
downloadillumos-joyent-6de7dd38d5e1d12791b18f60b9cad431c7d4b419.tar.gz
11861 hostbridge topo module should be hardened to handle empty busses
Reviewed by: Yuri Pankov <ypankov@fastmail.com> Reviewed by: Toomas Soome <tsoome@me.com> Reviewed by: Paul Winder <paul@winders.demon.co.uk> Approved by: Joshua M. Clulow <josh@sysmgr.org>
-rw-r--r--usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
index b8d89db32d..8968c70c95 100644
--- a/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
+++ b/usr/src/lib/fm/topo/modules/i86pc/hostbridge/hb_i86pc.c
@@ -93,6 +93,18 @@ pci_hostbridges_find(topo_mod_t *mod, tnode_t *ptn)
pnode = di_drv_first_node(PCI, devtree);
while (pnode != DI_NODE_NIL) {
+ /*
+ * We've seen cases where certain phantom PCI hostbridges have
+ * appeared on systems. If we encounter a host bridge without a
+ * bus address assigned to it, then we should skip processing it
+ * here as that indicates that it generally doesn't have any
+ * devices under it and we'll otherwise blow up in devinfo.
+ */
+ if (di_bus_addr(pnode) == NULL) {
+ pnode = di_drv_next_node(pnode);
+ continue;
+ }
+
if (hb_process(mod, ptn, hbcnt, pnode) < 0) {
if (hbcnt == 0)
topo_node_range_destroy(ptn, HOSTBRIDGE);