Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 2 Dec 2007 01:23:12 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 129949 for review
Message-ID:  <200712020123.lB21NCuP024644@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=129949

Change 129949 by hselasky@hselasky_laptop001 on 2007/12/02 01:22:37

	
	Make sure that the alignment is correct when
	allocating DMA memory.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#59 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#59 (text+ko) ====

@@ -2082,6 +2082,16 @@
 	bus_dmamap_t map;
 	void *ptr;
 
+	if (align != 1) {
+		/*
+	         * The alignment must be greater or equal to the "size" else the
+	         * object can be split between two memory pages and we get a
+	         * problem!
+	         */
+		while (align < size) {
+			align *= 2;
+		}
+	}
 	/* get the correct DMA tag */
 	tag = usbd_dma_tag_setup(parent_tag, utag, size, align, utag_max);
 	if (tag == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712020123.lB21NCuP024644>