Subject: kern/18449: random kernel panic occurs while playing uaudio at ohci
To: None <gnats-bugs@gnats.netbsd.org>
From: None <t-nkyma@tcp-ip.or.jp>
List: netbsd-bugs
Date: 09/29/2002 02:53:49
>Number:         18449
>Category:       kern
>Synopsis:       random kernel panic occurs while playing uaudio at ohci
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Sep 28 10:54:00 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator:     Takeshi Nakayama
>Release:        NetBSD 1.6
>Organization:
Private
>Environment:
System: NetBSD nyx 1.6 NetBSD 1.6 (NYX32) #39: Fri Sep 27 18:42:10 JST 2002
 takeshi@nyx:/usr/src/sys/arch/sparc64/compile/NYX32 sparc64
Architecture: sparc
Machine: sparc64

ohci0 at pci0 dev 10 function 0: Acer Labs M5237 USB Host Controller (rev. 0x03)
usb0 at ohci0: USB revision 1.0
uhub0 at usb0
uaudio0 at uhub0 port 2 configuration 1 interface 0: YAMAHA YAMAHA YST-M45D USB Speaker, rev 1.00/1.00, addr 2

>Description:
	see Synopsis.

>How-To-Repeat:
	Play a mp3 with USB audio under heavy load (e.g. make build
	in /usr/src).

>Fix:
	It seems some interrupt block is missing. Applying the
	following fixes this issue.

Index: ohci.c
===================================================================
RCS file: /cvsroot/syssrc/sys/dev/usb/ohci.c,v
retrieving revision 1.127
diff -u -d -r1.127 ohci.c
--- ohci.c	2002/08/07 20:03:19	1.127
+++ ohci.c	2002/09/16 04:01:26
@@ -597,6 +597,7 @@
 			  OHCI_ITD_ALIGN, &dma);
 		if (err)
 			return (NULL);
+		s = splusb();
 		for(i = 0; i < OHCI_SITD_CHUNK; i++) {
 			offs = i * OHCI_SITD_SIZE;
 			sitd = KERNADDR(&dma, offs);
@@ -604,6 +605,7 @@
 			sitd->nextitd = sc->sc_freeitds;
 			sc->sc_freeitds = sitd;
 		}
+		splx(s);
 	}
 
 	s = splusb();
@@ -1201,8 +1203,11 @@
 ohci_rhsc_enable(void *v_sc)
 {
 	ohci_softc_t *sc = v_sc;
+	int s;
 
+	s = splhardusb();
 	ohci_rhsc_able(sc, 1);
+	splx(s);
 }
 
 #ifdef OHCI_DEBUG
>Release-Note:
>Audit-Trail:
>Unformatted: