Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb More usb_syncmem tweaks. The main one is sync'i...



details:   https://anonhg.NetBSD.org/src/rev/b5700db5d155
branches:  trunk
changeset: 821412:b5700db5d155
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sat Feb 04 08:03:40 2017 +0000

description:
More usb_syncmem tweaks.  The main one is sync'ing the entire last TD
returned from ohci_reset_std_chain in control transfers.

diffstat:

 sys/dev/usb/ohci.c |  13 ++++++-------
 1 files changed, 6 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r e666769ec8be -r b5700db5d155 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Sat Feb 04 01:32:54 2017 +0000
+++ b/sys/dev/usb/ohci.c        Sat Feb 04 08:03:40 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.272 2017/01/31 07:34:02 skrll Exp $ */
+/*     $NetBSD: ohci.c,v 1.273 2017/02/04 08:03:40 skrll Exp $ */
 
 /*
  * Copyright (c) 1998, 2004, 2005, 2012 The NetBSD Foundation, Inc.
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.272 2017/01/31 07:34:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.273 2017/02/04 08:03:40 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2760,9 +2760,7 @@
                end->td.td_nexttd = HTOO32(stat->physaddr);
                end->nexttd = stat;
 
-               usb_syncmem(&end->dma,
-                   end->offs + offsetof(ohci_td_t, td_nexttd),
-                   sizeof(end->td.td_nexttd),
+               usb_syncmem(&end->dma, end->offs, sizeof(end->td),
                    BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
 
                usb_syncmem(&xfer->ux_dmabuf, 0, len,
@@ -3005,7 +3003,7 @@
        tail->nexttd = NULL;
        tail->xfer = NULL;
        usb_syncmem(&tail->dma, tail->offs, sizeof(tail->td),
-           BUS_DMASYNC_PREWRITE);
+           BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
        xfer->ux_hcpriv = data;
 
        DPRINTFN(8, "xfer %p data %p tail %p", xfer, ox->ox_stds[0], tail, 0);
@@ -3202,7 +3200,7 @@
        tail->nexttd = NULL;
        tail->xfer = NULL;
        usb_syncmem(&tail->dma, tail->offs, sizeof(tail->td),
-           BUS_DMASYNC_PREWRITE);
+           BUS_DMASYNC_PREWRITE | BUS_DMASYNC_PREREAD);
        xfer->ux_hcpriv = data;
 
        DPRINTFN(8, "data %p tail %p", ox->ox_stds[0], tail, 0, 0);
@@ -3536,6 +3534,7 @@
                        ncur = 0;
                }
                sitd->itd.itd_offset[ncur] = HTOO16(OHCI_ITD_MK_OFFS(offs));
+               /* XXX Sync */
                offs = noffs;
        }
        KASSERT(j <= ox->ox_nsitd);



Home | Main Index | Thread Index | Old Index