Index: uspace/srv/devman/dev.c
===================================================================
--- uspace/srv/devman/dev.c	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/dev.c	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -50,4 +51,6 @@
 	refcount_init(&dev->refcnt);
 	list_initialize(&dev->functions);
+	fibril_mutex_initialize(&dev->state_lock);
+	fibril_condvar_initialize(&dev->state_cv);
 	link_initialize(&dev->driver_devices);
 
@@ -87,4 +90,16 @@
 	if (refcount_down(&dev->refcnt))
 		delete_dev_node(dev);
+}
+
+/** Wait until the device node enters stable state.
+ *
+ * @param dev Device node
+ */
+void dev_wait_stable(dev_node_t *dev)
+{
+	fibril_mutex_lock(&dev->state_lock);
+	while (dev->state == DEVICE_ATTACHING)
+		fibril_condvar_wait(&dev->state_cv, &dev->state_lock);
+	fibril_mutex_unlock(&dev->state_lock);
 }
 
Index: uspace/srv/devman/dev.h
===================================================================
--- uspace/srv/devman/dev.h	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/dev.h	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,5 +1,5 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
- * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -41,4 +41,5 @@
 extern void dev_add_ref(dev_node_t *);
 extern void dev_del_ref(dev_node_t *);
+extern void dev_wait_stable(dev_node_t *);
 
 extern dev_node_t *find_dev_node_no_lock(dev_tree_t *tree,
Index: uspace/srv/devman/devman.h
===================================================================
--- uspace/srv/devman/devman.h	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/devman.h	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,5 +1,5 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
- * Copyright (c) 2011 Jiri Svoboda
  * All rights reserved.
  *
@@ -105,4 +105,5 @@
 typedef enum {
 	DEVICE_NOT_INITIALIZED = 0,
+	DEVICE_ATTACHING,
 	DEVICE_USABLE,
 	DEVICE_NOT_PRESENT,
@@ -129,4 +130,8 @@
 	/** The state of the device. */
 	device_state_t state;
+	/** Protect device state field */
+	fibril_mutex_t state_lock;
+	/** Signalled when device state changes */
+	fibril_condvar_t state_cv;
 	/** Link to list of devices owned by driver (driver_t.devices) */
 	link_t driver_devices;
Index: uspace/srv/devman/devtree.c
===================================================================
--- uspace/srv/devman/devtree.c	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/devtree.c	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,3 +1,4 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -314,4 +315,16 @@
 }
 
+/** Wait for device tree to stabilize.
+ *
+ * Blocks until the entire device tree had a chance to finish attaching
+ * all devices.
+ *
+ * @param tree Device tree
+ */
+void dev_tree_wait_stable(dev_tree_t *tree)
+{
+	dev_wait_stable(tree->root_node->child);
+}
+
 /** @}
  */
Index: uspace/srv/devman/devtree.h
===================================================================
--- uspace/srv/devman/devtree.h	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/devtree.h	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,5 +1,5 @@
 /*
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
- * Copyright (c) 2013 Jiri Svoboda
  * All rights reserved.
  *
@@ -45,4 +45,5 @@
 extern bool insert_fun_node(dev_tree_t *, fun_node_t *, char *, dev_node_t *);
 extern void remove_fun_node(dev_tree_t *, fun_node_t *);
+extern void dev_tree_wait_stable(dev_tree_t *);
 
 #endif
Index: uspace/srv/devman/driver.c
===================================================================
--- uspace/srv/devman/driver.c	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/driver.c	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2018 Jiri Svoboda
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -284,5 +284,8 @@
 	dev->drv = drv;
 	dev->passed_to_driver = false;
-	dev->state = DEVICE_NOT_INITIALIZED;
+	fibril_mutex_lock(&dev->state_lock);
+	dev->state = DEVICE_ATTACHING;
+	fibril_mutex_unlock(&dev->state_lock);
+	fibril_condvar_broadcast(&dev->state_cv);
 	list_append(&dev->driver_devices, &drv->devices);
 
@@ -631,4 +634,7 @@
 void add_device(driver_t *drv, dev_node_t *dev, dev_tree_t *tree)
 {
+	link_t *link;
+	fun_node_t *fun;
+
 	/*
 	 * We do not expect to have driver's mutex locked as we do not
@@ -664,4 +670,33 @@
 		async_wait_for(req, &rc);
 	}
+
+	if (rc == EOK) {
+		log_msg(LOG_DEFAULT, LVL_DEBUG, "Device was added. Wait for "
+		    "child functions' devices to stabilize.");
+		fibril_rwlock_read_lock(&tree->rwlock);
+		link = list_first(&dev->functions);
+		while (link != NULL) {
+			fun = list_get_instance(link, fun_node_t,
+			    dev_functions);
+
+			if (fun->child != NULL) {
+				log_msg(LOG_DEFAULT, LVL_DEBUG2, "Wait for "
+				    "child device %p.", (void *)fun->child);
+				fun_add_ref(fun);
+				fibril_rwlock_read_unlock(&tree->rwlock);
+				dev_wait_stable(fun->child);
+				fibril_rwlock_read_lock(&tree->rwlock);
+				fun_del_ref(fun);
+			}
+
+			link = list_next(link, &dev->functions);
+		}
+
+		fibril_rwlock_read_unlock(&tree->rwlock);
+		log_msg(LOG_DEFAULT, LVL_DEBUG,
+		    "Finished waiting for children.");
+	}
+
+	fibril_mutex_lock(&dev->state_lock);
 
 	switch (rc) {
@@ -677,4 +712,7 @@
 	}
 
+	fibril_mutex_unlock(&dev->state_lock);
+	fibril_condvar_broadcast(&dev->state_cv);
+
 	dev->passed_to_driver = true;
 }
Index: uspace/srv/devman/main.c
===================================================================
--- uspace/srv/devman/main.c	(revision a796812c405518891216868c0051c7e9bd48cc2c)
+++ uspace/srv/devman/main.c	(revision c3d9aaf561afb8b493c3460b1898f33b5499c920)
@@ -1,4 +1,4 @@
 /*
- * Copyright (c) 2023 Jiri Svoboda
+ * Copyright (c) 2025 Jiri Svoboda
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -369,4 +369,7 @@
 
 	printf("%s: Accepting connections.\n", NAME);
+	log_msg(LOG_DEFAULT, LVL_NOTE, "Wait for device tree to stabilize.");
+	dev_tree_wait_stable(&device_tree);
+	log_msg(LOG_DEFAULT, LVL_NOTE, "Device tree stable.");
 	task_retval(0);
 	async_manager();
