Index: uspace/lib/usb/src/hub.c
===================================================================
--- uspace/lib/usb/src/hub.c	(revision 1998bcd74c2564129f5663487195a7f45d99a7bb)
+++ uspace/lib/usb/src/hub.c	(revision 9806479563c9b6c65c1e33cfdbedb416a67de6b3)
@@ -235,25 +235,9 @@
 	}
 
-
-	/*
-	 * Reserve the default address.
-	 */
-	rc = usb_hc_reserve_default_address(&hc_conn, dev_speed);
-	if (rc != EOK) {
-		rc = EBUSY;
-		goto leave_release_free_address;
-	}
-
-	/*
-	 * Enable the port (i.e. allow signaling through this port).
-	 */
-	rc = enable_port(port_no, arg);
-	if (rc != EOK) {
-		goto leave_release_default_address;
-	}
-
-	/*
-	 * Change the address from default to the free one.
-	 * We need to create a new control pipe for that.
+	/*
+	 * We will not register control pipe on default address.
+	 * The registration might fail. That means that someone else already
+	 * registered that endpoint. We will simply wait and try again.
+	 * (Someone else already wants to add a new device.)
 	 */
 	usb_device_connection_t dev_conn;
@@ -262,5 +246,5 @@
 	if (rc != EOK) {
 		rc = ENOTCONN;
-		goto leave_release_default_address;
+		goto leave_release_free_address;
 	}
 
@@ -270,16 +254,33 @@
 	if (rc != EOK) {
 		rc = ENOTCONN;
+		goto leave_release_free_address;
+	}
+
+	do {
+		rc = usb_pipe_register_with_speed(&ctrl_pipe, dev_speed, 0,
+		    &hc_conn);
+		if (rc != EOK) {
+			/* Do not overheat the CPU ;-). */
+			async_usleep(10);
+		}
+	} while (rc != EOK);
+
+	/*
+	 * Endpoint is registered. We can enable the port and change
+	 * device address.
+	 */
+	rc = enable_port(port_no, arg);
+	if (rc != EOK) {
 		goto leave_release_default_address;
 	}
 
-	/* Before sending any traffic, we need to register this
-	 * endpoint.
-	 */
-	rc = usb_pipe_register(&ctrl_pipe, 0, &hc_conn);
-	if (rc != EOK) {
-		rc = EREFUSED;
+	rc = usb_pipe_probe_default_control(&ctrl_pipe);
+	if (rc != EOK) {
+		rc = ESTALL;
 		goto leave_release_default_address;
 	}
-	rc = usb_pipe_probe_default_control(&ctrl_pipe);
+
+
+	rc = usb_pipe_start_session(&ctrl_pipe);
 	if (rc != EOK) {
 		rc = ENOTCONN;
@@ -287,10 +288,4 @@
 	}
 
-	rc = usb_pipe_start_session(&ctrl_pipe);
-	if (rc != EOK) {
-		rc = ENOTCONN;
-		goto leave_unregister_endpoint;
-	}
-
 	rc = usb_request_set_address(&ctrl_pipe, dev_addr);
 	if (rc != EOK) {
@@ -302,22 +297,16 @@
 
 	/*
-	 * Register the control endpoint for the new device.
+	 * Address changed. We can release the original endpoint, thus
+	 * allowing other to access the default address.
+	 */
+	unregister_control_endpoint_on_default_address(&hc_conn);
+
+	/*
+	 * Time to register the new endpoint.
 	 */
 	rc = usb_pipe_register(&ctrl_pipe, 0, &hc_conn);
 	if (rc != EOK) {
-		rc = EREFUSED;
-		goto leave_unregister_endpoint;
-	}
-
-	/*
-	 * Release the original endpoint.
-	 */
-	unregister_control_endpoint_on_default_address(&hc_conn);
-
-	/*
-	 * Once the address is changed, we can return the default address.
-	 */
-	usb_hc_release_default_address(&hc_conn);
-
+		goto leave_release_free_address;
+	}
 
 	/*
@@ -334,6 +323,4 @@
 	}
 
-
-
 	/*
 	 * And now inform the host controller about the handle.
@@ -371,9 +358,6 @@
 	usb_pipe_end_session(&ctrl_pipe);
 
-leave_unregister_endpoint:
+leave_release_default_address:
 	usb_pipe_unregister(&ctrl_pipe, &hc_conn);
-
-leave_release_default_address:
-	usb_hc_release_default_address(&hc_conn);
 
 leave_release_free_address:
