Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/dwc2 Do BUS_DMASYNC_POST{READ, WRITE} on tra...



details:   https://anonhg.NetBSD.org/src/rev/c0978af9ea2a
branches:  trunk
changeset: 340113:c0978af9ea2a
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Aug 23 11:15:08 2015 +0000

description:
Do BUS_DMASYNC_POST{READ,WRITE} on transfer buffers appropriately

diffstat:

 sys/external/bsd/dwc2/dwc2.c |  18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diffs (39 lines):

diff -r 833c1e1df589 -r c0978af9ea2a sys/external/bsd/dwc2/dwc2.c
--- a/sys/external/bsd/dwc2/dwc2.c      Sun Aug 23 11:12:01 2015 +0000
+++ b/sys/external/bsd/dwc2/dwc2.c      Sun Aug 23 11:15:08 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dwc2.c,v 1.33 2015/08/18 12:01:16 skrll Exp $  */
+/*     $NetBSD: dwc2.c,v 1.34 2015/08/23 11:15:08 skrll Exp $  */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.33 2015/08/18 12:01:16 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.34 2015/08/23 11:15:08 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1754,6 +1754,20 @@
                printf("%s: unknown error status %d\n", __func__, status);
        }
 
+       if (xfer->status == USBD_NORMAL_COMPLETION) {
+               int rd = usbd_xfer_isread(xfer);
+
+               /*
+                * control transfers with no data phase don't touch dmabuf, but
+                * everything else does.
+                */
+               if (!(xfertype == UE_CONTROL &&
+                   UGETW(xfer->request.wLength) == 0)) {
+                       usb_syncmem(&xfer->dmabuf, 0, xfer->actlen,
+                           rd ? BUS_DMASYNC_POSTREAD : BUS_DMASYNC_POSTWRITE);
+               }
+       }
+
        if (xfertype == UE_ISOCHRONOUS ||
            xfertype == UE_INTERRUPT) {
                struct dwc2_pipe *dpipe = DWC2_XFER2DPIPE(xfer);



Home | Main Index | Thread Index | Old Index