Module Name:    src
Committed By:   jmcneill
Date:           Sat Jul 30 20:05:36 UTC 2011

Modified Files:
        src/sys/dev/usb: ohci.c usbdi.c

Log Message:
PR# port-i386/18818: cannot enter ddb with usb keyboard

- ohci: when polling, make sure sc_eintrs has the OHCI_WDH flag set
  otherwise ohci_intr1 won't actually read data
- usbdi: kick the host controller by calling its soft_intr callback when
  switching out of polling mode too

DDB with a USB keyboard works for me now with ohci.


To generate a diff of this commit:
cvs rdiff -u -r1.216 -r1.217 src/sys/dev/usb/ohci.c
cvs rdiff -u -r1.132 -r1.133 src/sys/dev/usb/usbdi.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/ohci.c
diff -u src/sys/dev/usb/ohci.c:1.216 src/sys/dev/usb/ohci.c:1.217
--- src/sys/dev/usb/ohci.c:1.216	Thu Jun  9 19:08:31 2011
+++ src/sys/dev/usb/ohci.c	Sat Jul 30 20:05:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: ohci.c,v 1.216 2011/06/09 19:08:31 matt Exp $	*/
+/*	$NetBSD: ohci.c,v 1.217 2011/07/30 20:05:36 jmcneill Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/ohci.c,v 1.22 1999/11/17 22:33:40 n_hibma Exp $	*/
 
 /*
@@ -41,7 +41,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.216 2011/06/09 19:08:31 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ohci.c,v 1.217 2011/07/30 20:05:36 jmcneill Exp $");
 
 #include "opt_usb.h"
 
@@ -1645,6 +1645,7 @@
 	}
 #endif
 
+	sc->sc_eintrs |= OHCI_WDH;
 	if (OREAD4(sc, OHCI_INTERRUPT_STATUS) & sc->sc_eintrs)
 		ohci_intr1(sc);
 }

Index: src/sys/dev/usb/usbdi.c
diff -u src/sys/dev/usb/usbdi.c:1.132 src/sys/dev/usb/usbdi.c:1.133
--- src/sys/dev/usb/usbdi.c:1.132	Thu Jun  9 19:08:33 2011
+++ src/sys/dev/usb/usbdi.c	Sat Jul 30 20:05:36 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbdi.c,v 1.132 2011/06/09 19:08:33 matt Exp $	*/
+/*	$NetBSD: usbdi.c,v 1.133 2011/07/30 20:05:36 jmcneill Exp $	*/
 /*	$FreeBSD: src/sys/dev/usb/usbdi.c,v 1.28 1999/11/17 22:33:49 n_hibma Exp $	*/
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.132 2011/06/09 19:08:33 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbdi.c,v 1.133 2011/07/30 20:05:36 jmcneill Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_usb.h"
@@ -1073,9 +1073,9 @@
 		dev->bus->use_polling++;
 	else
 		dev->bus->use_polling--;
-	/* When polling we need to make sure there is nothing pending to do. */
-	if (dev->bus->use_polling)
-		dev->bus->methods->soft_intr(dev->bus);
+
+	/* Kick the host controller when switching modes */
+	dev->bus->methods->soft_intr(dev->bus);
 }
 
 

Reply via email to