Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Sep 2010 23:47:05 +0000 (UTC)
From:      Weongyo Jeong <weongyo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r212983 - user/weongyo/usb/sys/dev/usb
Message-ID:  <201009212347.o8LNl5S0010238@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: weongyo
Date: Tue Sep 21 23:47:05 2010
New Revision: 212983
URL: http://svn.freebsd.org/changeset/base/212983

Log:
  Adds a XXX comment about assertion by USB stack when it handles multiple
  DMA segments.

Modified:
  user/weongyo/usb/sys/dev/usb/usb_busdma.c

Modified: user/weongyo/usb/sys/dev/usb/usb_busdma.c
==============================================================================
--- user/weongyo/usb/sys/dev/usb/usb_busdma.c	Tue Sep 21 23:25:38 2010	(r212982)
+++ user/weongyo/usb/sys/dev/usb/usb_busdma.c	Tue Sep 21 23:47:05 2010	(r212983)
@@ -449,7 +449,15 @@ usb_pc_common_mem_cb(void *arg, bus_dma_
 	}
 #endif
 	for (i = 1; i < nseg; i++) {
-		pg[i].physaddr = segs[i].ds_addr & ~(USB_PAGE_SIZE - 1);
+		/*
+		 * XXX Currently USB stack has a assumption that after second
+		 * segments always the address would be aligned by
+		 * USB_PAGE_SIZE.  If it's failed, all DMA operations would
+		 * be wrong.
+		 */
+		USB_ASSERT((segs[i].ds_addr & (USB_PAGE_SIZE - 1)) == 0,
+		    ("wrong DMA alignment (%#jx)", segs[i].ds_addr));
+		pg[i].physaddr = segs[i].ds_addr;
 		pg[i].physlen = segs[i].ds_len;
 	}
 done:



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