On 11/09/15 13:19, Roger Pau Monné wrote:
+ if (dmat->common.flags & BUS_DMA_KEEP_PG_OFFSET) {
+ /*
+ * If we have to keep the offset of each page this function
+ * is not suitable, switch back to bus_dmamap_load_ma_triv
+ * which is going to do the right thing in this case.
+ */
+ error = bus_dmamap_load_ma_triv(dmat, map, ma, buflen, ma_offs,
+ flags, segs, segp);
+ return (error);
+ }
Hi,
There has been an update made to the USB stack, which is currently the
only client of "BUS_DMA_KEEP_PG_OFFSET", which means this check can
probably be skipped or relaxed a bit. The condition which must be
fullfilled is:
#ifdef USB_DEBUG
if (nseg > 1 &&
((segs->ds_addr + segs->ds_len) & (USB_PAGE_SIZE - 1)) !=
((segs + 1)->ds_addr & (USB_PAGE_SIZE - 1))) {
/*
* This check verifies there is no page offset hole
* between the first and second segment. See the
* BUS_DMA_KEEP_PG_OFFSET flag.
*/
DPRINTFN(0, "Page offset was not preserved\n");
error = 1;
goto done;
}
#endif
See: sys/dev/usb/usb_busdma.c
--HPS
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"