Date: Fri, 26 Sep 2008 19:27:59 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 150524 for review Message-ID: <200809261927.m8QJRxmj066531@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=150524 Change 150524 by hselasky@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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200809261927.m8QJRxmj066531>