Date: Sat, 18 Sep 2010 08:25:12 +0000 (UTC) From: Marius Strobl <marius@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r212819 - stable/8/sys/dev/usb Message-ID: <201009180825.o8I8PCdL057636@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: marius Date: Sat Sep 18 08:25:12 2010 New Revision: 212819 URL: http://svn.freebsd.org/changeset/base/212819 Log: MFC: r212621 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. Reviewed by: Hans Petter Selasky Modified: stable/8/sys/dev/usb/usb_busdma.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/dev/usb/usb_busdma.c ============================================================================== --- stable/8/sys/dev/usb/usb_busdma.c Sat Sep 18 08:23:45 2010 (r212818) +++ stable/8/sys/dev/usb/usb_busdma.c Sat Sep 18 08:25:12 2010 (r212819) @@ -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?201009180825.o8I8PCdL057636>