Subject: kern/13430: UHCI_DEBUG calls uhci_dump_all() independant of uhcidebug
To: None <gnats-bugs@gnats.netbsd.org>
From: John Hawkinson <jhawk@mit.edu>
List: netbsd-bugs
Date: 07/10/2001 22:42:02
>Number:         13430
>Category:       kern
>Synopsis:       UHCI_DEBUG calls uhci_dump_all() independant of uhcidebug
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 10 19:46:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     John Hawkinson
>Release:        -current of 24 Jun 2001
>Organization:
MIT
>Environment:
	
System: NetBSD zorkmid.mit.edu 1.5W NetBSD 1.5W (ZORKMID-$Revision: 1.12 $) #104: Sun Jun 24 21:48:35 EDT 2001 jhawk@zorkmid.mit.edu:/usr/local/netbsd-current/src/sys/arch/i386/compile/ZORKMID i386


>Description:
	After some potentially sketchy usb activities, specifically
I think I suspended my machine and removed a usb serial adaptor in quick
sucession, not sure what order (I THOUGHT I took it out first), waiting
a while, and bringing the machine back up, I started getting continual
uhci_debug_all() logs.

	I have uhcidebug set to zero.

	It seems that uhci_intr() unconditionally calls uhci_debug_all()
in some cases. Most cases are protected by uhcidebug checks. Should
not this one be too?
>How-To-Repeat:
not sure. These are my logs:

Jul 10 16:59:52 zorkmid root: apm script: /etc/apm/suspend
Jul 10 19:43:17 zorkmid /netbsd: fxp0: WARNING: SCB timed out!
Jul 10 19:43:17 zorkmid last message repeated 2 times
Jul 10 19:43:17 zorkmid /netbsd: fxp0 at line 1937: dmasync timeout
Jul 10 19:43:17 zorkmid /netbsd: fxp0: WARNING: SCB timed out!
Jul 10 19:43:17 zorkmid /netbsd: fxp0: WARNING: SCB timed out!
Jul 10 19:43:17 zorkmid /netbsd: fxp0 at line 1520: dmasync timeout
Jul 10 19:43:17 zorkmid /netbsd: uhci0: host controller process error
Jul 10 19:43:20 zorkmid /netbsd: uhci0: host controller halted
Jul 10 19:43:20 zorkmid /netbsd: uhci0 regs: cmd=0000, sts=0030, intr=000f, frnu
m=0728, flbase=00004ca0, sof=0040, portsc1=0080, portsc2=0080
Jul 10 19:43:20 zorkmid /netbsd: intrs=1448994
Jul 10 19:43:20 zorkmid /netbsd: QH(0xc6451f80) at 00006f80: hlink=00006fa2 elin
k=00000001
Jul 10 19:43:17 zorkmid root: apm script: /etc/apm/resume
Jul 10 19:43:17 zorkmid apmd: system resumed from APM sleep
Jul 10 22:26:42 zorkmid /netbsd: uhci0 regs: cmd=0000, sts=0020, intr=000f, frnu
m=0728, flbase=00004ca0, sof=0040, portsc1=0080, portsc2=0080
Jul 10 22:26:42 zorkmid /netbsd: intrs=1448995
Jul 10 22:26:42 zorkmid /netbsd: QH(0xc6451f80) at 00006f80: hlink=00006fa2 elin
k=00000001
Jul 10 22:26:42 zorkmid /netbsd: uhci0 regs: cmd=0000, sts=0020, intr=000f, frnu
m=0728, flbase=00004ca0, sof=0040, portsc1=0080, portsc2=0080
Jul 10 22:26:42 zorkmid /netbsd: intrs=1448995
Jul 10 22:26:42 zorkmid /netbsd: QH(0xc6451f80) at 00006f80: hlink=00006fa2 elin
k=00000001
Jul 10 22:26:42 zorkmid /netbsd: uhci0 regs: cmd=0000, sts=0020, intr=000f, frnu
m=0728, flbase=00004ca0, sof=0040, portsc1=0080, portsc2=0080
Jul 10 22:26:42 zorkmid /netbsd: intrs=1448995
Jul 10 22:26:42 zorkmid /netbsd: QH(0xc6451f80) at 00006f80: hlink=00006fa2 elin
k=00000001

>Fix:
	Here's a proposed fix. As a temporary workaround, I just NOP'd the call 
	out of my running kernel.

Index: uhci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/uhci.c,v
retrieving revision 1.135
diff -u -r1.135 uhci.c
--- uhci.c	2001/04/01 14:59:52	1.135
+++ uhci.c	2001/07/11 02:46:24
@@ -1203,7 +1203,8 @@
 			    USBDEVNAME(sc->sc_bus.bdev));
 		sc->sc_dying = 1;
 #ifdef UHCI_DEBUG
-		uhci_dump_all(sc);
+		if (uhcidebug > 2)
+			uhci_dump_all(sc);
 #endif
 
 	}
>Release-Note:
>Audit-Trail:
>Unformatted: