Since rev1.85 of dev/usb/usbdi.c the USB stack does DMA synchronization
in usb_transfer_complete().  That mean we can now remove some code from
the HC drivers that were performing this synchronization.

ok?

Index: ehci.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/ehci.c,v
retrieving revision 1.194
diff -u -p -r1.194 ehci.c
--- ehci.c      2 Oct 2016 06:36:39 -0000       1.194
+++ ehci.c      6 Nov 2016 13:32:12 -0000
@@ -3102,9 +3102,6 @@ ehci_device_bulk_done(struct usbd_xfer *
 
        if (xfer->status != USBD_NOMEM) {
                ehci_free_sqtd_chain(sc, ex);
-               usb_syncmem(&xfer->dmabuf, 0, xfer->length,
-                   usbd_xfer_isread(xfer) ?
-                   BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
        }
 }
 
@@ -3265,9 +3262,6 @@ ehci_device_intr_done(struct usbd_xfer *
                splx(s);
        } else if (xfer->status != USBD_NOMEM) {
                ehci_free_sqtd_chain(sc, ex);
-               usb_syncmem(&xfer->dmabuf, 0, xfer->length,
-                   usbd_xfer_isread(xfer) ?
-                   BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
        }
 }
 
Index: xhci.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/xhci.c,v
retrieving revision 1.69
diff -u -p -r1.69 xhci.c
--- xhci.c      3 Oct 2016 14:05:21 -0000       1.69
+++ xhci.c      6 Nov 2016 13:27:48 -0000
@@ -2661,9 +2661,6 @@ xhci_device_generic_start(struct usbd_xf
 void
 xhci_device_generic_done(struct usbd_xfer *xfer)
 {
-       usb_syncmem(&xfer->dmabuf, 0, xfer->length, usbd_xfer_isread(xfer) ?
-           BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
-
        /* Only happens with interrupt transfers. */
        if (xfer->pipe->repeat) {
                xfer->actlen = 0;

Reply via email to