Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb PR/51202: XHCI driver sends stale TRBs from a pi...



details:   https://anonhg.NetBSD.org/src/rev/16e843f7569f
branches:  trunk
changeset: 345711:16e843f7569f
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Jun 05 10:45:16 2016 +0000

description:
PR/51202: XHCI driver sends stale TRBs from a pipe previously opened

Use xhci_host_dequeue in xhci_set_dequeue

diffstat:

 sys/dev/usb/xhci.c |  12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)

diffs (33 lines):

diff -r 16bae39225af -r 16e843f7569f sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Sun Jun 05 09:21:14 2016 +0000
+++ b/sys/dev/usb/xhci.c        Sun Jun 05 10:45:16 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.55 2016/06/05 09:16:02 skrll Exp $  */
+/*     $NetBSD: xhci.c,v 1.56 2016/06/05 10:45:16 skrll Exp $  */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.55 2016/06/05 09:16:02 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.56 2016/06/05 10:45:16 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -1356,13 +1356,7 @@
        XHCIHIST_FUNC(); XHCIHIST_CALLED();
        DPRINTFN(4, "slot %u dci %u", xs->xs_idx, dci, 0, 0);
 
-       memset(xr->xr_trb, 0, xr->xr_ntrb * XHCI_TRB_SIZE);
-       usb_syncmem(&xr->xr_dma, 0, xr->xr_ntrb * XHCI_TRB_SIZE,
-           BUS_DMASYNC_PREWRITE);
-       memset(xr->xr_cookies, 0, xr->xr_ntrb * sizeof(*xr->xr_cookies));
-
-       xr->xr_ep = 0;
-       xr->xr_cs = 1;
+       xhci_host_dequeue(xr);
 
        /* set DCS */
        trb.trb_0 = xhci_ring_trbp(xr, 0) | 1; /* XXX */



Home | Main Index | Thread Index | Old Index