Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb don't lock if we are polling because we are alre...



details:   https://anonhg.NetBSD.org/src/rev/b6cf2cf9609f
branches:  trunk
changeset: 827890:b6cf2cf9609f
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Nov 16 21:54:51 2017 +0000

description:
don't lock if we are polling because we are already holding a spin lock
from uhci_poll().

diffstat:

 sys/dev/usb/uhci.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r 01c4fdf395cf -r b6cf2cf9609f sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Thu Nov 16 19:41:41 2017 +0000
+++ b/sys/dev/usb/uhci.c        Thu Nov 16 21:54:51 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.277 2017/10/28 00:37:12 pgoyette Exp $      */
+/*     $NetBSD: uhci.c,v 1.278 2017/11/16 21:54:51 christos Exp $      */
 
 /*
  * Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@@ -42,7 +42,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.277 2017/10/28 00:37:12 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.278 2017/11/16 21:54:51 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2754,7 +2754,8 @@
 #endif
 
        /* Take lock to protect nexttoggle */
-       mutex_enter(&sc->sc_lock);
+       if (!sc->sc_bus.ub_usepolling)
+               mutex_enter(&sc->sc_lock);
        uhci_reset_std_chain(sc, xfer, xfer->ux_length, isread,
            &upipe->nexttoggle, &dataend);
 
@@ -2786,7 +2787,8 @@
        }
        uhci_add_intr_list(sc, ux);
        xfer->ux_status = USBD_IN_PROGRESS;
-       mutex_exit(&sc->sc_lock);
+       if (!sc->sc_bus.ub_usepolling)
+               mutex_exit(&sc->sc_lock);
 
 #ifdef UHCI_DEBUG
        if (uhcidebug >= 10) {



Home | Main Index | Thread Index | Old Index