svn commit: r212983 - user/weongyo/usb/sys/dev/usb
Weongyo Jeong
weongyo at FreeBSD.org
Tue Sep 21 23:47:05 UTC 2010
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:
More information about the svn-src-user
mailing list