Module Name:    src
Committed By:   skrll
Date:           Sun Apr 10 15:47:58 UTC 2016

Modified Files:
        src/sys/dev/usb [nick-nhusb]: xhci.c

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

>From Takahiro HAYASHI


To generate a diff of this commit:
cvs rdiff -u -r1.28.2.57 -r1.28.2.58 src/sys/dev/usb/xhci.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/xhci.c
diff -u src/sys/dev/usb/xhci.c:1.28.2.57 src/sys/dev/usb/xhci.c:1.28.2.58
--- src/sys/dev/usb/xhci.c:1.28.2.57	Sun Apr 10 15:46:46 2016
+++ src/sys/dev/usb/xhci.c	Sun Apr 10 15:47:58 2016
@@ -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 @@ xhci_handle_event(struct xhci_softc * co
 
 	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 @@ xhci_softintr(void *v)
 
 	XHCIHIST_FUNC(); XHCIHIST_CALLED();
 
+	KASSERT(sc->sc_bus.ub_usepolling || mutex_owned(&sc->sc_lock));
+
 	i = er->xr_ep;
 	j = er->xr_cs;
 

Reply via email to