Index: uspace/drv/bus/usb/ehci/ehci_batch.c
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_batch.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/ehci_batch.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -84,5 +84,4 @@
 
 	usb_transfer_batch_init(&ehci_batch->base, ep);
-	link_initialize(&ehci_batch->link);
 
 	return ehci_batch;
Index: uspace/drv/bus/usb/ehci/ehci_batch.h
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_batch.h	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/ehci_batch.h	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -49,6 +49,4 @@
 	/** Number of TDs used by the transfer */
 	size_t td_count;
-	/** Link */
-	link_t link;
 	/** Endpoint descriptor of the target endpoint. */
 	qh_t *qh;
@@ -70,10 +68,4 @@
 void ehci_transfer_batch_destroy(ehci_transfer_batch_t *batch);
 
-static inline ehci_transfer_batch_t *ehci_transfer_batch_from_link(link_t *l)
-{
-	assert(l);
-	return list_get_instance(l, ehci_transfer_batch_t, link);
-}
-
 static inline ehci_transfer_batch_t * ehci_transfer_batch_get(usb_transfer_batch_t *usb_batch)
 {
Index: uspace/drv/bus/usb/ehci/ehci_bus.c
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_bus.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/ehci_bus.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -77,5 +77,6 @@
 	ehci_ep->qh = ehci_ep->dma_buffer.virt;
 
-	link_initialize(&ehci_ep->link);
+	link_initialize(&ehci_ep->eplist_link);
+	link_initialize(&ehci_ep->pending_link);
 	return &ehci_ep->base;
 }
@@ -116,9 +117,38 @@
 	bus_t *bus_base = endpoint_get_bus(ep);
 	ehci_bus_t *bus = (ehci_bus_t *) bus_base;
+	hc_t *hc = bus->hc;
 	assert(bus);
 	assert(ep);
 
 	usb2_bus_ops.endpoint_unregister(ep);
-	hc_dequeue_endpoint(bus->hc, ep);
+	hc_dequeue_endpoint(hc, ep);
+
+	ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep);
+
+	/*
+	 * Now we can be sure the active transfer will not be completed. But first,
+	 * make sure that the handling fibril won't use its link in pending list.
+	 */
+	fibril_mutex_lock(&hc->guard);
+	if (link_in_use(&ehci_ep->pending_link))
+		/* pending list reference */
+		endpoint_del_ref(ep);
+	list_remove(&ehci_ep->pending_link);
+	fibril_mutex_unlock(&hc->guard);
+
+	/*
+	 * Finally, the endpoint shall not be used anywhere else. Finish the
+	 * pending batch.
+	 */
+	fibril_mutex_lock(&ep->guard);
+	usb_transfer_batch_t * const batch = ep->active_batch;
+	endpoint_deactivate_locked(ep);
+	fibril_mutex_unlock(&ep->guard);
+
+	if (batch) {
+		batch->error = EINTR;
+		batch->transfered_size = 0;
+		usb_transfer_batch_finish(batch);
+	}
 }
 
Index: uspace/drv/bus/usb/ehci/ehci_bus.h
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_bus.h	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/ehci_bus.h	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -53,6 +53,10 @@
 	
 	dma_buffer_t dma_buffer;
-	/** Linked list used by driver software */
-	link_t link;
+
+	/** Link in endpoint_list */
+	link_t eplist_link;
+
+	/** Link in pending_endpoints */
+	link_t pending_link;
 } ehci_endpoint_t;
 
@@ -80,5 +84,5 @@
 static inline ehci_endpoint_t * ehci_endpoint_list_instance(link_t *l)
 {
-	return list_get_instance(l, ehci_endpoint_t, link);
+	return list_get_instance(l, ehci_endpoint_t, eplist_link);
 }
 
Index: uspace/drv/bus/usb/ehci/endpoint_list.c
===================================================================
--- uspace/drv/bus/usb/ehci/endpoint_list.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/endpoint_list.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -124,5 +124,5 @@
 	write_barrier();
 	/* Add to the sw list */
-	list_append(&ep->link, &instance->endpoint_list);
+	list_append(&ep->eplist_link, &instance->endpoint_list);
 
 	ehci_endpoint_t *first = ehci_endpoint_list_instance(
@@ -159,10 +159,10 @@
 	qh_t *prev_qh;
 	/* Remove from the hardware queue */
-	if (list_first(&instance->endpoint_list) == &ep->link) {
+	if (list_first(&instance->endpoint_list) == &ep->eplist_link) {
 		/* I'm the first one here */
 		prev_qh = instance->list_head;
 		qpos = "FIRST";
 	} else {
-		prev_qh = ehci_endpoint_list_instance(ep->link.prev)->qh;
+		prev_qh = ehci_endpoint_list_instance(ep->eplist_link.prev)->qh;
 		qpos = "NOT FIRST";
 	}
@@ -176,5 +176,5 @@
 
 	/* Remove from the endpoint list */
-	list_remove(&ep->link);
+	list_remove(&ep->eplist_link);
 	fibril_mutex_unlock(&instance->guard);
 }
Index: uspace/drv/bus/usb/ehci/hc.c
===================================================================
--- uspace/drv/bus/usb/ehci/hc.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/hc.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -173,5 +173,5 @@
 	    + EHCI_RD8(instance->caps->caplength));
 
-	list_initialize(&instance->pending_batches);
+	list_initialize(&instance->pending_endpoints);
 	fibril_mutex_initialize(&instance->guard);
 	fibril_condvar_initialize(&instance->async_doorbell);
@@ -299,17 +299,35 @@
 	}
 
+	endpoint_t * const ep = batch->ep;
+	ehci_endpoint_t * const ehci_ep = ehci_endpoint_get(ep);
+
+	/* creating local reference */
+	endpoint_add_ref(ep);
+
+	fibril_mutex_lock(&ep->guard);
+	endpoint_activate_locked(ep, batch);
+
 	ehci_transfer_batch_t *ehci_batch = ehci_transfer_batch_get(batch);
-
 	const int err = ehci_transfer_batch_prepare(ehci_batch);
-	if (err)
+	if (err) {
+		endpoint_deactivate_locked(ep);
+		fibril_mutex_unlock(&ep->guard);
+		/* dropping local reference */
+		endpoint_del_ref(ep);
 		return err;
-
+	}
+
+	usb_log_debug("HC(%p): Committing BATCH(%p)", hc, batch);
+	ehci_transfer_batch_commit(ehci_batch);
+	fibril_mutex_unlock(&ep->guard);
+
+	/* Enqueue endpoint to the checked list */
 	fibril_mutex_lock(&hc->guard);
 	usb_log_debug2("HC(%p): Appending BATCH(%p)", hc, batch);
-	list_append(&ehci_batch->link, &hc->pending_batches);
-	usb_log_debug("HC(%p): Committing BATCH(%p)", hc, batch);
-	ehci_transfer_batch_commit(ehci_batch);
-
+
+	/* local reference -> pending list reference */
+	list_append(&ehci_ep->pending_link, &hc->pending_endpoints);
 	fibril_mutex_unlock(&hc->guard);
+
 	return EOK;
 }
@@ -341,18 +359,31 @@
 
 	if (status & (USB_STS_IRQ_FLAG | USB_STS_ERR_IRQ_FLAG)) {
+
+		LIST_INITIALIZE(completed);
+
 		fibril_mutex_lock(&hc->guard);
 
-		usb_log_debug2("HC(%p): Scanning %lu pending batches", hc,
-			list_count(&hc->pending_batches));
-		list_foreach_safe(hc->pending_batches, current, next) {
-			ehci_transfer_batch_t *batch =
-			    ehci_transfer_batch_from_link(current);
+		usb_log_debug2("HC(%p): Scanning %lu pending endpoints", hc,
+			list_count(&hc->pending_endpoints));
+		list_foreach_safe(hc->pending_endpoints, current, next) {
+			ehci_endpoint_t *ep
+				= list_get_instance(current, ehci_endpoint_t, pending_link);
+
+			fibril_mutex_lock(&ep->base.guard);
+			ehci_transfer_batch_t *batch
+				= ehci_transfer_batch_get(ep->base.active_batch);
+			assert(batch);
 
 			if (ehci_transfer_batch_check_completed(batch)) {
+				endpoint_deactivate_locked(&ep->base);
 				list_remove(current);
+				endpoint_del_ref(&ep->base);
 				usb_transfer_batch_finish(&batch->base);
 			}
+			fibril_mutex_unlock(&ep->base.guard);
 		}
 		fibril_mutex_unlock(&hc->guard);
+
+
 	}
 
Index: uspace/drv/bus/usb/ehci/hc.h
===================================================================
--- uspace/drv/bus/usb/ehci/hc.h	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/hc.h	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -75,5 +75,5 @@
 
 	/** List of active transfers */
-	list_t pending_batches;
+	list_t pending_endpoints;
 
 	/** Guards schedule and endpoint manipulation */
Index: uspace/drv/bus/usb/ehci/main.c
===================================================================
--- uspace/drv/bus/usb/ehci/main.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/ehci/main.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -67,5 +67,5 @@
 {
 	log_init(NAME);
-	logctl_set_log_level(NAME, LVL_NOTE);
+	logctl_set_log_level(NAME, LVL_DEBUG2);
 	return hc_driver_main(&ehci_driver);
 }
Index: uspace/drv/bus/usb/uhci/main.c
===================================================================
--- uspace/drv/bus/usb/uhci/main.c	(revision d60115a5571c1d7a5330d0cd74e3abdef172ec0c)
+++ uspace/drv/bus/usb/uhci/main.c	(revision 8ad2b0a99f1326c29aad2873ef275fc1d343f087)
@@ -92,5 +92,5 @@
 	printf(NAME ": HelenOS UHCI driver.\n");
 	log_init(NAME);
-	logctl_set_log_level(NAME, LVL_DEBUG2);
+	logctl_set_log_level(NAME, LVL_NOTE);
 	return hc_driver_main(&uhci_driver);
 }
