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 require the lock if we are polling (earl...



details:   https://anonhg.NetBSD.org/src/rev/58a95c8b4fd0
branches:  trunk
changeset: 345083:58a95c8b4fd0
user:      christos <christos%NetBSD.org@localhost>
date:      Fri May 06 20:12:54 2016 +0000

description:
- don't require the lock if we are polling (early autoconf)
- unfold a line

diffstat:

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

diffs (46 lines):

diff -r 65c610db5672 -r 58a95c8b4fd0 sys/dev/usb/uhci.c
--- a/sys/dev/usb/uhci.c        Fri May 06 18:07:17 2016 +0000
+++ b/sys/dev/usb/uhci.c        Fri May 06 20:12:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uhci.c,v 1.271 2016/05/06 13:03:06 skrll Exp $ */
+/*     $NetBSD: uhci.c,v 1.272 2016/05/06 20:12:54 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.271 2016/05/06 13:03:06 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.272 2016/05/06 20:12:54 christos Exp $");
 
 #include "opt_usb.h"
 
@@ -1105,7 +1105,7 @@
        uhci_soft_qh_t *pqh;
        uint32_t elink;
 
-       KASSERT(mutex_owned(&sc->sc_lock));
+       KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
 
        UHCIHIST_FUNC(); UHCIHIST_CALLED();
        DPRINTFN(10, "sqh %p", sqh, 0, 0, 0);
@@ -1146,8 +1146,7 @@
        pqh->hlink = sqh->hlink;
        pqh->qh.qh_hlink = sqh->qh.qh_hlink;
        usb_syncmem(&pqh->dma, pqh->offs + offsetof(uhci_qh_t, qh_hlink),
-           sizeof(pqh->qh.qh_hlink),
-           BUS_DMASYNC_PREWRITE);
+           sizeof(pqh->qh.qh_hlink), BUS_DMASYNC_PREWRITE);
        delay(UHCI_QH_REMOVE_DELAY);
        if (sc->sc_hctl_end == sqh)
                sc->sc_hctl_end = pqh;
@@ -1185,7 +1184,7 @@
        uhci_soft_qh_t *pqh;
        uint32_t elink;
 
-       KASSERT(mutex_owned(&sc->sc_lock));
+       KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
 
        UHCIHIST_FUNC(); UHCIHIST_CALLED();
        DPRINTFN(10, "sqh %p", sqh, 0, 0, 0);



Home | Main Index | Thread Index | Old Index