Source-Changes-HG archive

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

[src/nick-nhusb]: src/sys/dev/usb Wait for hardware before removing the TDs f...



details:   https://anonhg.NetBSD.org/src/rev/60ae5dafb338
branches:  nick-nhusb
changeset: 334450:60ae5dafb338
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Mar 24 15:30:17 2016 +0000

description:
Wait for hardware before removing the TDs from the hash lists.

This is all a bit racey and should be revisited.

diffstat:

 sys/dev/usb/ohci.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r fd05112a5d3a -r 60ae5dafb338 sys/dev/usb/ohci.c
--- a/sys/dev/usb/ohci.c        Wed Mar 23 22:18:30 2016 +0000
+++ b/sys/dev/usb/ohci.c        Thu Mar 24 15:30:17 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ohci.c,v 1.254.2.59 2016/03/17 09:04:53 skrll Exp $    */
+/*     $NetBSD: ohci.c,v 1.254.2.60 2016/03/24 15:30:17 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.254.2.59 2016/03/17 09:04:53 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.254.2.60 2016/03/24 15:30:17 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -3728,6 +3728,8 @@
        sitd = xfer->ux_hcpriv;
        KASSERT(sitd);
 
+       usb_delay_ms_locked(&sc->sc_bus, OHCI_ITD_NOFFSET, &sc->sc_lock);
+
        for (; sitd->xfer == xfer; sitd = sitd->nextitd) {
                ohci_hash_rem_itd(sc, sitd);
 #ifdef DIAGNOSTIC
@@ -3736,8 +3738,6 @@
 #endif
        }
 
-       usb_delay_ms_locked(&sc->sc_bus, OHCI_ITD_NOFFSET, &sc->sc_lock);
-
        /* Run callback. */
        usb_transfer_complete(xfer);
 



Home | Main Index | Thread Index | Old Index