Date: Tue, 14 Sep 2010 20:41:07 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r212621 - head/sys/dev/usb Message-ID: <201009142041.o8EKf7RB092174@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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,
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009142041.o8EKf7RB092174>