svn commit: r212621 - head/sys/dev/usb

Marius Strobl marius at FreeBSD.org
Tue Sep 14 20:41:07 UTC 2010


Author: marius
Date: Tue Sep 14 20:41:06 2010
New Revision: 212621
URL: http://svn.freebsd.org/changeset/base/212621

Log:
  Use saner nsegments and maxsegsz parameters when creating certain DMA tags;
  tags for 1-byte allocations cannot possibly be split across 2 segments and
  maxsegsz must not exceed maxsize.

Modified:
  head/sys/dev/usb/usb_busdma.c

Modified: head/sys/dev/usb/usb_busdma.c
==============================================================================
--- head/sys/dev/usb/usb_busdma.c	Tue Sep 14 20:31:09 2010	(r212620)
+++ head/sys/dev/usb/usb_busdma.c	Tue Sep 14 20:41:06 2010	(r212621)
@@ -366,9 +366,9 @@ usb_dma_tag_create(struct usb_dma_tag *u
 	     /* filter    */ NULL,
 	     /* filterarg */ NULL,
 	     /* maxsize   */ size,
-	     /* nsegments */ (align == 1) ?
+	     /* nsegments */ (align == 1 && size > 1) ?
 	    (2 + (size / USB_PAGE_SIZE)) : 1,
-	     /* maxsegsz  */ (align == 1) ?
+	     /* maxsegsz  */ (align == 1 && size > USB_PAGE_SIZE) ?
 	    USB_PAGE_SIZE : size,
 	     /* flags     */ BUS_DMA_KEEP_PG_OFFSET,
 	     /* lockfn    */ &usb_dma_lock_cb,


More information about the svn-src-head mailing list