Index: uspace/drv/bus/usb/uhcirh/port.c
===================================================================
--- uspace/drv/bus/usb/uhcirh/port.c	(revision 0d103aef79ca5d6b82df2eec9eab93e74195627e)
+++ uspace/drv/bus/usb/uhcirh/port.c	(revision fb4223125c21ea94d51e457ff45fa01295d20a6c)
@@ -44,4 +44,6 @@
 #include "port.h"
 
+#define MAX_ERROR_COUNT 5
+
 static int uhci_port_check(void *port);
 static int uhci_port_reset_enable(void *arg);
@@ -151,4 +153,17 @@
 	assert(instance);
 
+	unsigned allowed_failures = MAX_ERROR_COUNT;
+#define CHECK_RET_FAIL(ret, msg...) \
+	if (ret != EOK) { \
+		usb_log_error(msg); \
+		if (!(allowed_failures-- > 0)) { \
+			usb_log_fatal( \
+			   "Maximum number of failures reached, " \
+			   "bailing out.\n"); \
+			return ret; \
+		} \
+		continue; \
+	} else (void)0
+
 	while (1) {
 		async_usleep(instance->wait_period_usec);
@@ -165,25 +180,18 @@
 			continue;
 
-		int ret =
-		    usb_hc_connection_open(&instance->hc_connection);
-		if (ret != EOK) {
-			usb_log_error("%s: Failed to connect to HC.",
-			    instance->id_string);
-			continue;
-		}
-
 		usb_log_debug("%s: Connected change detected: %x.\n",
 		    instance->id_string, port_status);
 
+		int ret = usb_hc_connection_open(&instance->hc_connection);
+		CHECK_RET_FAIL(ret, "%s: Failed to connect to HC %s.\n",
+		    instance->id_string, str_error(ret));
+
 		/* Remove any old device */
 		if (instance->attached_device.fun) {
-			usb_log_debug2("%s: Removing device.\n",
-			    instance->id_string);
 			uhci_port_remove_device(instance);
 		}
 
-
 		if ((port_status & STATUS_CONNECTED) != 0) {
-			/* New device */
+			/* New device, this will take care of WC bits */
 			const usb_speed_t speed =
 			    ((port_status & STATUS_LOW_SPEED) != 0) ?
@@ -198,8 +206,6 @@
 
 		ret = usb_hc_connection_close(&instance->hc_connection);
-		if (ret != EOK) {
-			usb_log_error("%s: Failed to disconnect.",
-			    instance->id_string);
-		}
+		CHECK_RET_FAIL(ret, "%s: Failed to disconnect from hc: %s.\n",
+		    instance->id_string, str_error(ret));
 	}
 	return EOK;
@@ -258,5 +264,5 @@
 	usb_log_debug("%s: Detected new device.\n", port->id_string);
 
-	int ret, count = 0;
+	int ret, count = MAX_ERROR_COUNT;
 	do {
 		ret = usb_hc_new_device_wrapper(port->rh, &port->hc_connection,
@@ -264,5 +270,5 @@
 		    &port->attached_device.address, NULL, NULL,
 		    &port->attached_device.fun);
-	} while (ret != EOK && ++count < 4);
+	} while (ret != EOK && count-- > 0);
 
 	if (ret != EOK) {
@@ -273,6 +279,6 @@
 	}
 
-	usb_log_info("New device at port %u, address %d (handle %" PRIun ").\n",
-	    port->number, port->attached_device.address,
+	usb_log_info("%s: New device, address %d (handle %" PRIun ").\n",
+	    port->id_string, port->attached_device.address,
 	    port->attached_device.fun->handle);
 	return EOK;
