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 Fix lock assertion in xhci_softintr() when ...



details:   https://anonhg.NetBSD.org/src/rev/342ede686b3c
branches:  nick-nhusb
changeset: 334482:342ede686b3c
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Apr 10 15:47:58 2016 +0000

description:
Fix lock assertion in xhci_softintr() when entering DDB on ukbd.
Move this KASSERT to xhci_softintr() from xhci_handle_event().

>From Takahiro HAYASHI

diffstat:

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

diffs (36 lines):

diff -r 8ded3f621f5a -r 342ede686b3c sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Sun Apr 10 15:46:46 2016 +0000
+++ b/sys/dev/usb/xhci.c        Sun Apr 10 15:47:58 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.28.2.57 2016/04/10 15:46:46 skrll Exp $     */
+/*     $NetBSD: xhci.c,v 1.28.2.58 2016/04/10 15:47:58 skrll Exp $     */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.57 2016/04/10 15:46:46 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.28.2.58 2016/04/10 15:47:58 skrll Exp $");
 
 #include "opt_usb.h"
 
@@ -1950,8 +1950,6 @@
 
        XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
-       KASSERT(mutex_owned(&sc->sc_lock));
-
        trb_0 = le64toh(trb->trb_0);
        trb_2 = le32toh(trb->trb_2);
        trb_3 = le32toh(trb->trb_3);
@@ -2001,6 +1999,8 @@
 
        XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
+       KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
+
        i = er->xr_ep;
        j = er->xr_cs;
 



Home | Main Index | Thread Index | Old Index