Index: uspace/drv/bus/usb/ehci/ehci_batch.c
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_batch.c	(revision 56b55693a45a7d7c11fc14ec84d50d9f1db90f4d)
+++ uspace/drv/bus/usb/ehci/ehci_batch.c	(revision 090eea6883b5fb36abe0047be9edd57f4b2776b4)
@@ -72,4 +72,5 @@
 	free32(ehci_batch->device_buffer);
 	free(ehci_batch);
+	usb_log_debug2("Batch(%p): disposed", ehci_batch);
 }
 
@@ -104,5 +105,6 @@
 	    calloc(1, sizeof(ehci_transfer_batch_t));
 	if (!ehci_batch) {
-		usb_log_error("Failed to allocate EHCI batch data.");
+		usb_log_error("Batch %p: Failed to allocate EHCI batch data.",
+		    usb_batch);
 		goto dispose;
 	}
@@ -119,5 +121,6 @@
 	ehci_batch->tds = calloc(ehci_batch->td_count, sizeof(td_t*));
 	if (!ehci_batch->tds) {
-		usb_log_error("Failed to allocate EHCI transfer descriptors.");
+		usb_log_error("Batch %p: Failed to allocate EHCI transfer "
+		    "descriptors.", usb_batch);
 		goto dispose;
 	}
@@ -129,5 +132,6 @@
 		ehci_batch->tds[i] = malloc32(sizeof(td_t));
 		if (!ehci_batch->tds[i]) {
-			usb_log_error("Failed to allocate TD %d.", i);
+			usb_log_error("Batch %p: Failed to allocate TD %d.",
+			    usb_batch, i);
 			goto dispose;
 		}
@@ -142,5 +146,6 @@
 		    malloc32(usb_batch->setup_size + usb_batch->buffer_size);
 		if (!ehci_batch->device_buffer) {
-			usb_log_error("Failed to allocate device buffer");
+			usb_log_error("Batch %p: Failed to allocate device "
+			    "buffer", usb_batch);
 			goto dispose;
 		}
@@ -184,8 +189,9 @@
 	assert(ehci_batch->usb_batch);
 
-	usb_log_debug("Batch %p checking %zu td(s) for completion.\n",
+	usb_log_debug("Batch %p: checking %zu td(s) for completion.\n",
 	    ehci_batch->usb_batch, ehci_batch->td_count);
 
-	usb_log_debug2("QH: %08x:%08x:%08x:%08x:%08x:%08x.\n",
+	usb_log_debug2("Batch %p: QH: %08x:%08x:%08x:%08x:%08x:%08x.\n",
+	    ehci_batch->usb_batch,
 	    ehci_batch->qh->ep_char, ehci_batch->qh->ep_cap,
 	    ehci_batch->qh->status, ehci_batch->qh->current,
@@ -206,5 +212,6 @@
 	for (size_t i = 0; i < ehci_batch->td_count; ++i) {
 		assert(ehci_batch->tds[i] != NULL);
-		usb_log_debug("TD %zu: %08x:%08x:%08x.", i,
+		usb_log_debug("Batch %p: TD %zu: %08x:%08x:%08x.",
+		    ehci_batch->usb_batch, i,
 		    ehci_batch->tds[i]->status, ehci_batch->tds[i]->next,
 		    ehci_batch->tds[i]->alternate);
@@ -227,5 +234,5 @@
 			    -= td_remain_size(ehci_batch->tds[i]);
 		} else {
-			usb_log_debug("Batch %p found error TD(%zu):%08x (%d).\n",
+			usb_log_debug("Batch %p found error TD(%zu):%08x (%d).",
 			    ehci_batch->usb_batch, i,
 			    ehci_batch->tds[i]->status,
@@ -273,5 +280,6 @@
 	assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT);
 
-	usb_log_debug2("Control QH(%"PRIxn"): %08x:%08x:%08x:%08x:%08x:%08x",
+	usb_log_debug2("Batch %p: Control QH(%"PRIxn"): "
+	    "%08x:%08x:%08x:%08x:%08x:%08x", ehci_batch->usb_batch,
 	    addr_to_phys(ehci_batch->qh),
 	    ehci_batch->qh->ep_char, ehci_batch->qh->ep_cap,
@@ -291,5 +299,6 @@
 	td_init(ehci_batch->tds[0], ehci_batch->tds[1], USB_DIRECTION_BOTH,
 	    buffer, ehci_batch->usb_batch->setup_size, toggle, false);
-	usb_log_debug2("Created CONTROL SETUP TD(%"PRIxn"): %08x:%08x:%08x",
+	usb_log_debug2("Batch %p: Created CONTROL SETUP TD(%"PRIxn"): "
+	    "%08x:%08x:%08x", ehci_batch->usb_batch,
 	    addr_to_phys(ehci_batch->tds[0]),
 	    ehci_batch->tds[0]->status, ehci_batch->tds[0]->next,
@@ -308,5 +317,6 @@
 		    ehci_batch->tds[td_current + 1], data_dir, buffer,
 		    transfer_size, toggle, false);
-		usb_log_debug2("Created CONTROL DATA TD(%"PRIxn"): %08x:%08x:%08x",
+		usb_log_debug2("Batch %p: Created CONTROL DATA TD(%"PRIxn"): "
+		    "%08x:%08x:%08x", ehci_batch->usb_batch,
 		    addr_to_phys(ehci_batch->tds[td_current]),
 		    ehci_batch->tds[td_current]->status,
@@ -323,5 +333,6 @@
 	assert(td_current == ehci_batch->td_count - 1);
 	td_init(ehci_batch->tds[td_current], NULL, status_dir, NULL, 0, 1, true);
-	usb_log_debug2("Created CONTROL STATUS TD(%"PRIxn"): %08x:%08x:%08x",
+	usb_log_debug2("Batch %p: Created CONTROL STATUS TD(%"PRIxn"): "
+	    "%08x:%08x:%08x", ehci_batch->usb_batch,
 	    addr_to_phys(ehci_batch->tds[td_current]),
 	    ehci_batch->tds[td_current]->status,
@@ -344,5 +355,6 @@
 	assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT);
 
-	usb_log_debug2("Control QH(%"PRIxn"): %08x:%08x:%08x:%08x:%08x:%08x",
+	usb_log_debug2("Batch %p: Data QH(%"PRIxn"): "
+	    "%08x:%08x:%08x:%08x:%08x:%08x", ehci_batch->usb_batch,
 	    addr_to_phys(ehci_batch->qh),
 	    ehci_batch->qh->ep_char, ehci_batch->qh->ep_cap,
@@ -363,5 +375,6 @@
 		    dir, buffer, transfer_size, -1, last);
 
-		usb_log_debug2("Created DATA TD(%"PRIxn": %08x:%08x:%08x",
+		usb_log_debug2("Batch %p: DATA TD(%"PRIxn": %08x:%08x:%08x",
+		    ehci_batch->usb_batch,
 		    addr_to_phys(ehci_batch->tds[td_current]),
 		    ehci_batch->tds[td_current]->status,
