=== modified file 'uspace/drv/ohci/hc.c'
--- uspace/drv/ohci/hc.c	2011-05-27 13:06:14 +0000
+++ uspace/drv/ohci/hc.c	2011-06-18 19:54:45 +0000
@@ -34,6 +34,7 @@
 #include <errno.h>
 #include <str_error.h>
 #include <adt/list.h>
+#include <time.h>
 #include <libarch/ddi.h>
 
 #include <usb/debug.h>
@@ -472,13 +473,16 @@
 	}
 	usb_log_debug2("HC reset complete in %zu us.\n", time);
 
+	struct timeval start, end;
+	int ret = gettimeofday(&start, NULL);
+	assert(ret == EOK);
+
+	/* hc is now in suspend state */
+	usb_log_debug2("HC should be in suspend state(%x):%x.\n",
+	    C_HCFS_SUSPEND << C_HCFS_SHIFT, instance->registers->control);
+
 	/* Restore fm_interval */
 	instance->registers->fm_interval = fm_interval;
-	assert((instance->registers->command_status & CS_HCR) == 0);
-
-	/* hc is now in suspend state */
-	usb_log_debug2("HC should be in suspend state(%x).\n",
-	    instance->registers->control);
 
 	/* Use HCCA */
 	instance->registers->hcca = addr_to_phys(instance->hcca);
@@ -514,7 +518,28 @@
 	    instance->registers->periodic_start,
 	    instance->registers->periodic_start, frame_length);
 
-	instance->registers->control &= (C_HCFS_OPERATIONAL << C_HCFS_SHIFT);
+	ret = gettimeofday(&end, NULL);
+	assert(ret == EOK);
+
+	/* The Host Controller is now in the USBSUSPEND state;
+	 * it must not stay in this state more than 2 ms
+	 * or the USBRESUME state will need to be entered for
+	 * the minimum time specified in the USB Specification
+	 * for the assertion of resume on the USB.
+	 * OpenHCI - 5.1.1.4
+	 */
+	if (tv_sub(&end, &start) > 2000) {
+		usb_log_info("OHCI setup took too long, force resume.\n");
+		/* We may use simple &= to change status as RESUME is bit
+		 * subset of SUSPEND (suspend = 0x3, resume 0x1)*/
+		instance->registers->control &=
+		    (C_HCFS_RESUME << C_HCFS_SHIFT);
+		async_usleep(20000);
+
+	}
+	instance->registers->control =
+	    (instance->registers->control & ~(C_HCFS_MASK << C_HCFS_SHIFT)) |
+	    (C_HCFS_OPERATIONAL << C_HCFS_SHIFT);
 	usb_log_info("OHCI HC up and running(%x).\n",
 	    instance->registers->control);
 }

