PERFORCE change 150524 for review

Hans Petter Selasky hselasky at FreeBSD.org
Fri Sep 26 19:28:00 UTC 2008


http://perforce.freebsd.org/chv.cgi?CH=150524

Change 150524 by hselasky at hselasky_laptop001 on 2008/09/26 19:27:31

	
	Reduce the need for memory. This also fixes an
	issue where the BUS-DMA refuses to allocate the
	memory due to the aligment and size combination.
	I was not able to find the real reason for the
	failure, but this patch fixes the problem for now.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_busdma.c#8 edit
.. //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#29 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_busdma.c#8 (text+ko) ====

@@ -495,7 +495,7 @@
 		 * memory, hence we sometimes to a large number of
 		 * small allocations!
 		 */
-		if (size < USB_PAGE_SIZE) {
+		if (size <= (USB_PAGE_SIZE / 2)) {
 			size *= 2;
 		}
 #endif

==== //depot/projects/usb/src/sys/dev/usb2/core/usb2_transfer.c#29 (text+ko) ====

@@ -942,10 +942,12 @@
 		parm.size[1] = parm.size[0];
 
 		/*
-		 * UHCI need DMA tags for fixup buffers. There
-		 * is a maximum of one tag for each endpoint.
+		 * The number of DMA tags required depends on
+		 * the number of endpoints. The current estimate
+		 * for maximum number of DMA tags per endpoint
+		 * is two.
 		 */
-		parm.dma_tag_max += MIN(n_setup, USB_EP_MAX);
+		parm.dma_tag_max += 2 * MIN(n_setup, USB_EP_MAX);
 
 		/*
 		 * DMA tags for QH, TD, Data and more.


More information about the p4-projects mailing list