PERFORCE change 134192 for review

Hans Petter Selasky hselasky at FreeBSD.org
Sun Jan 27 05:46:41 PST 2008


http://perforce.freebsd.org/chv.cgi?CH=134192

Change 134192 by hselasky at hselasky_laptop001 on 2008/01/27 13:46:33

	
	Bugfix. Only extend segments if we are multi segmented
	which is defined by the physical memory alignment being
	equal to 1.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#87 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#96 edit

Differences ...

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

@@ -2318,7 +2318,7 @@
 	 * XXX so we need to extend the last segment if we are
 	 * XXX unaligned and cross the segment boundary!
 	 */
-	if (ext_seg) {
+	if (ext_seg && pc->ismultiseg) {
 		(pg + 1)->physaddr = pg->physaddr + USB_PAGE_SIZE;
 	}
 	if (xfer) {
@@ -2381,6 +2381,7 @@
 	pc->page_offset_end = size;
 	pc->map = map;
 	pc->tag = tag;
+	pc->ismultiseg = (align == 1);
 
 	/* load memory into DMA */
 	if (bus_dmamap_load
@@ -2635,7 +2636,7 @@
 	 * XXX so we need to extend the last segment if we are
 	 * XXX unaligned and cross the segment boundary!
 	 */
-	if (ext_seg) {
+	if (ext_seg && pc->ismultiseg) {
 		(pg + 1)->physaddr = pg->physaddr + USB_PAGE_SIZE;
 	}
 	if (xfer) {
@@ -2722,6 +2723,7 @@
 	pc->page_offset_end = size;
 	pc->map = map;
 	pc->tag = tag;
+	pc->ismultiseg = (align == 1);
 
 	usbd_pc_alloc_mem_cb(pc, utag->p_seg, seg_count, 0);
 

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

@@ -262,6 +262,7 @@
 	uint32_t page_offset_buf;
 	uint32_t page_offset_end;
 	uint8_t	isread:1;
+	uint8_t ismultiseg:1; /* set if we can have multiple segments */
 };
 
 struct usbd_setup_params {


More information about the p4-projects mailing list