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,
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to