diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -1397,6 +1397,8 @@ device_t dev; devclass_t dc; + bus_topo_assert(); + PDEBUG(("%s at %s as unit %d", name, DEVICENAME(parent), unit)); if (name) { @@ -1511,6 +1513,8 @@ device_t child; device_t place; + bus_topo_assert(); + PDEBUG(("%s at %s with order %u as unit %d", name, DEVICENAME(dev), order, unit)); KASSERT(name != NULL || unit == DEVICE_UNIT_ANY, @@ -2414,6 +2418,8 @@ devclass_t dc; int error; + bus_topo_assert(); + if (!classname) { if (dev->devclass) devclass_delete_device(dev->devclass, dev); @@ -5218,6 +5224,7 @@ { switch (what) { case MOD_LOAD: + bus_topo_lock(); TAILQ_INIT(&bus_data_devices); kobj_class_compile((kobj_class_t) &root_driver); root_bus = make_device(NULL, "root", 0); @@ -5226,6 +5233,7 @@ root_bus->driver = &root_driver; root_bus->state = DS_ATTACHED; root_devclass = devclass_find_internal("root", NULL, FALSE); + bus_topo_unlock(); devctl2_init(); return (0);