From louie@whizzo.transsys.com  Fri Jul 14 22:36:30 2000
Return-Path: <louie@whizzo.transsys.com>
Received: from whizzo.transsys.com (whizzo.TransSys.COM [144.202.42.10])
	by hub.freebsd.org (Postfix) with ESMTP id 051A537BF60
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 14 Jul 2000 22:36:30 -0700 (PDT)
	(envelope-from louie@whizzo.transsys.com)
Received: (from louie@localhost)
	by whizzo.transsys.com (8.9.3/8.9.1) id BAA00840;
	Sat, 15 Jul 2000 01:36:28 -0400 (EDT)
	(envelope-from louie)
Message-Id: <200007150536.BAA00840@whizzo.transsys.com>
Date: Sat, 15 Jul 2000 01:36:28 -0400 (EDT)
From: Louis Mamakos <louie@TransSys.COM>
Sender: louie@whizzo.transsys.com
Reply-To: louie@TransSys.COM
To: FreeBSD-gnats-submit@freebsd.org
Subject: panic: nexus_setup_intr: NULL irq resource with GUS PnP 
X-Send-Pr-Version: 3.2

>Number:         19945
>Category:       kern
>Synopsis:       panic: nexus_setup_intr: NULL irq resource with GUS PnP
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    dick
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jul 14 22:40:01 PDT 2000
>Closed-Date:    Tue Jul 18 13:20:59 PDT 2000
>Last-Modified:  Thu Sep 13 12:43:07 GMT 2007
>Originator:     Louis Mamakos
>Release:        FreeBSD 5.0-CURRENT i386
>Organization:
>Environment:

AMD K6-III 450MHz
Gravis Ultrasound PnP board
FreeBSD 5.0-current as of 14 July 2000

>Description:

After upgrading to a recent 5.0-current, system would panic upon
boot with 

	panic: nexus_setup_intr: NULL irq resource!

>How-To-Repeat:

Find the no-longer-manufactured GUS PnP ISA sound board, and install
in your machine.

After removing drivers configred into the kernel, the system boots.  The
panic still occurs when performing either

	kldload snd_gusc.ko
or
	kldload snd_driver.ko

On the console, after performing either of these two commands appears:

gusc0: <Gravis UltraSound Plug & Play PCM> at port 0x220-0x226,0x320-0x327,0x32c-0x32f irq 11 drq 5,7 on isa0
gusc1: <Gravis UltraSound Plug & Play OPL> at port 0x38a-0x38b irq 9 drq 1 on isa0
panic: nexus_setup_intr: NULL irq resource!


>Fix:

Don't load sound driver (or configure them in the kernel); rather than
listening to mp3 files, listen to the sound of the keyboard..


output of pnpinfo command:

Checking for Plug-n-Play devices...

Card assigned CSN #1
Vendor ID GRV0001 (0x0100561e), Serial Number 0xffffffff
PnP Version 1.0, Vendor Version 18
Device Description: UltraSound Plug & Play

Logical Device ID: GRV0000 0x0000561e #0
	Device supports I/O Range Check
Device Description: Synth & Codec
TAG Start DF
Good Configuration
    IRQ: 11 12 15  - only one type (true/edge)
    DMA: channel(s) 5 
	16-bit, not a bus master, , count by word, Compatibility mode
    DMA: channel(s) 7 
	16-bit, not a bus master, , count by word, Compatibility mode
    I/O Range 0x220 .. 0x220, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x320 .. 0x320, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x32c .. 0x32c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7 11 12 15  - only one type (true/edge)
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    I/O Range 0x220 .. 0x220, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x320 .. 0x320, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x32c .. 0x32c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 11 12 15  - only one type (true/edge)
    DMA: channel(s) 5 
	16-bit, not a bus master, , count by word, Compatibility mode
    DMA: channel(s) 7 
	16-bit, not a bus master, , count by word, Compatibility mode
    I/O Range 0x240 .. 0x240, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x340 .. 0x340, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x34c .. 0x34c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7 11 12 15  - only one type (true/edge)
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    I/O Range 0x240 .. 0x240, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x340 .. 0x340, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x34c .. 0x34c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7 11 12 15  - only one type (true/edge)
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    I/O Range 0x230 .. 0x230, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x330 .. 0x330, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x33c .. 0x33c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7 11 12 15  - only one type (true/edge)
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    I/O Range 0x250 .. 0x250, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x350 .. 0x350, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x35c .. 0x35c, alignment 0x1, len 0x4
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7 11 12 15  - only one type (true/edge)
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    DMA: channel(s) 1 3 5 6 7 
	8/16-bit, not a bus master, count by byte, count by word, Compatibility mode
    I/O Range 0x260 .. 0x260, alignment 0x1, len 0x10
	[16-bit addr]
    I/O Range 0x360 .. 0x360, alignment 0x1, len 0x8
	[16-bit addr]
    I/O Range 0x36c .. 0x36c, alignment 0x1, len 0x4
	[16-bit addr]
TAG End DF

Logical Device ID: GRV0011 0x1100561e #1
	Device supports I/O Range Check
Device Description: Disabled Device

Logical Device ID: PNPb02f 0x2fb0d041 #2
	Device supports I/O Range Check
Device Description: Game Port
TAG Start DF
Good Configuration
    I/O Range 0x201 .. 0x201, alignment 0x1, len 0x1
	[16-bit addr]
TAG Start DF
Sub-optimal Configuration
    I/O Range 0x200 .. 0x2ff, alignment 0x1, len 0x1
	[16-bit addr]
TAG End DF

Logical Device ID: GRV0003 0x0300561e #3
	Device supports I/O Range Check
Device Description: SB Compatible Audio
    DMA: channel(s) 1 
	8-bit, not a bus master, count by byte, , Compatibility mode
TAG Start DF
Good Configuration
    IRQ: 5  - only one type (true/edge)
    I/O Range 0x388 .. 0x388, alignment 0x1, len 0x2
	[16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 5 7  - only one type (true/edge)
    I/O Range 0x388 .. 0x388, alignment 0x1, len 0x2
	[16-bit addr]
TAG Start DF
Sub-optimal Configuration
    IRQ: 3 5 7 9  - only one type (true/edge)
    I/O Range 0x38a .. 0x3f0, alignment 0x2, len 0x2
	[16-bit addr]
TAG End DF

Logical Device ID: GRV0004 0x0400561e #4
	Device supports I/O Range Check
Device Description: MPU-401 GM Music
TAG Start DF
Good Configuration
    I/O Range 0x330 .. 0x330, alignment 0x2, len 0x2
	[16-bit addr]
TAG Start DF
Sub-optimal Configuration
    I/O Range 0x300 .. 0x340, alignment 0x10, len 0x2
	[16-bit addr]
TAG Start DF
Sub-optimal Configuration
    I/O Range 0x332 .. 0x326, alignment 0x2, len 0x2
	[16-bit addr]
TAG End DF
End Tag

Successfully got 85 resources, 5 logical fdevs
-- card select # 0x0001

CSN GRV0001 (0x0100561e), Serial Number 0xffffffff

Logical device #0
IO:  0x0220 0x0220 0x0220 0x0220 0x0220 0x0220 0x0220 0x0220
IRQ 11 0
DMA 5 7
IO range check 0x00 activate 0x01

Logical device #1
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 0 0
DMA 4 4
IO range check 0x00 activate 0x01

Logical device #2
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 0 0
DMA 4 4
IO range check 0x00 activate 0x01

Logical device #3
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 9 0
DMA 4 4
IO range check 0x00 activate 0x01

Logical device #4
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 0 0
DMA 4 4
IO range check 0x00 activate 0x01


>Release-Note:
>Audit-Trail:

From: "Richard Seaman, Jr." <dick@tar.com>
To: Louis Mamakos <louie@TransSys.COM>, tanimura@FreeBSD.ORG
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/19945: panic: nexus_setup_intr: NULL irq resource with GUS PnP
Date: Sat, 15 Jul 2000 13:26:06 -0500

 On Sat, Jul 15, 2000 at 01:36:28AM -0400, Louis Mamakos wrote:
 
 > After upgrading to a recent 5.0-current, system would panic upon
 > boot with 
 > 
 > 	panic: nexus_setup_intr: NULL irq resource!
 
 I discovered the same thing here with my ancient Gus Pnp Pro.  Looks like
 the culprit is the newmidi code, recently committed.  I can boot
 with the following patch and play mp3's.  Don't know if midi works or not.
 
 BTW, sound playing doesn't work properly in all cases for me, in any case,
 without hacking the pcm/channel.c code a little.  The problem is that DMA
 interrupts don't get generated.  I'd be curious to know if you get interrupts
 when playing sounds (assuming the patch fixes things for you).  You can test
 this by typing "vmstat -i" before and after playing something.  Your card
 should show lots of interrupts (ie. at least hundreds according to Cameron
 Grant).  I don't get any, either before or after the newmidi commits. Note,
 if your card has 0 interrupts, it won't even print with vmstat.
 
 Index: gusc.c
 ===================================================================
 RCS file: /home/ncvs/src/sys/dev/sound/isa/gusc.c,v
 retrieving revision 1.7
 diff -u -r1.7 gusc.c
 --- gusc.c	2000/07/11 11:49:30	1.7
 +++ gusc.c	2000/07/15 18:02:33
 @@ -324,7 +324,8 @@
  		return (ENXIO);
  	}
  
 -	bus_setup_intr(dev, scp->irq, INTR_TYPE_TTY, gusc_intr, scp, &ih);
 +	if (scp->irq != NULL)
 +		bus_setup_intr(dev, scp->irq, INTR_TYPE_TTY, gusc_intr, scp, &ih);
  	bus_generic_attach(dev);
  
  	return (0);
 
 
 
 
 -- 
 Richard Seaman, Jr.        email:    dick@tar.com
 5182 N. Maple Lane         phone:    262-367-5450
 Nashotah WI 53058            fax:    262-367-5852
 
 
 
 
 
 
 
 

From: "Louis A. Mamakos" <louie@TransSys.COM>
To: "Richard Seaman, Jr." <dick@tar.com>
Cc: tanimura@FreeBSD.ORG, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/19945: panic: nexus_setup_intr: NULL irq resource with GUS PnP 
Date: Sat, 15 Jul 2000 16:59:21 -0400

 > I discovered the same thing here with my ancient Gus Pnp Pro.  Looks like
 > the culprit is the newmidi code, recently committed.  I can boot
 > with the following patch and play mp3's.  Don't know if midi works or not.
 
 I made the change you suggested, and loaded the snd_gusc.ko module.  It
 now doesn't panic, and now I see:
 
 gusc0: <Gravis UltraSound Plug & Play PCM> at port 0x220-0x22f,0x320-0x327,0x32c-0x32f irq 11 drq 5,7 on isa0
 gusc1: <Gravis UltraSound Plug & Play OPL> at port 0x38a-0x38b irq 9 drq 1 on isa0
 gusc2: <Gravis UltraSound Plug & Play MIDI> at port 0x330-0x331 on isa0
 
 There were no device, so I tried to load snd_pcm.ko, which caused
 
 pcm0: <GUS CS4231> on gusc0
 
 to be emitted on the console.  However, the kldload process is hung,
 waiting on "swwrt":
 
   UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
     0 79430 37865   4 -18  0   176    0 swwrt  D+    p1    0:08.69 kldload snd_driver.ko
 
 In this current state, the rest of the machine seems to be running just
 fine.  I'll try to add back:
 
 	device snd
 	device gusc
 
 in my config, and see what happens at next boot.  Currently, /dev/sndstat,
 /dev/dsp, etc. don't seem to be present. 
 
 > BTW, sound playing doesn't work properly in all cases for me, in any case,
 > without hacking the pcm/channel.c code a little.  The problem is that DMA
 > interrupts don't get generated.  I'd be curious to know if you get interrupts
 > when playing sounds (assuming the patch fixes things for you).  You can test
 > this by typing "vmstat -i" before and after playing something.  Your card
 > should show lots of interrupts (ie. at least hundreds according to Cameron
 > Grant).  I don't get any, either before or after the newmidi commits. Note,
 > if your card has 0 interrupts, it won't even print with vmstat.
 
 I'll give this a try and see what happens.  The Gus PnP board was working
 reasonably well in 5.0-current a couple of weeks ago (other than this
 weird static thing that happens every so often.)
 
 louie
 
 

From: "Richard Seaman, Jr." <dick@tar.com>
To: "Louis A. Mamakos" <louie@TransSys.COM>
Cc: "Richard Seaman, Jr." <dick@tar.com>, tanimura@FreeBSD.ORG,
	FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/19945: panic: nexus_setup_intr: NULL irq resource with GUS PnP
Date: Sat, 15 Jul 2000 16:23:41 -0500

 On Sat, Jul 15, 2000 at 04:59:21PM -0400, Louis A. Mamakos wrote:
 
 > There were no device, so I tried to load snd_pcm.ko, which caused
 > 
 > pcm0: <GUS CS4231> on gusc0
 > 
 > to be emitted on the console.  However, the kldload process is hung,
 > waiting on "swwrt":
 > 
 >   UID   PID  PPID CPU PRI NI   VSZ  RSS WCHAN  STAT  TT       TIME COMMAND
 >     0 79430 37865   4 -18  0   176    0 swwrt  D+    p1    0:08.69 kldload snd_driver.ko
 > 
 > In this current state, the rest of the machine seems to be running just
 > fine.  I'll try to add back:
 > 
 > 	device snd
 > 	device gusc
 > 
 > in my config, and see what happens at next boot.  Currently, /dev/sndstat,
 > /dev/dsp, etc. don't seem to be present. 
 
 Ok.  I never tried the kld since I had pcm in my kernel config.  BTW, I don't seem
 to need "device snd" or "device gusc" in my kernel config, only
 
 device pcm
 
 It still seems to find gusc just fine.  Since my message I also added:
 
 device		midi
 device		seq
 
 It appears that the midi driver does not get configured right, however.  
 Also, you might want to do a new MAKEDEV to get the midi devices.
 
 Jul 15 14:29:56 test /kernel: gusc0: <Gravis UltraSound Plug & Play PCM> at port 0x220-0x22f,0x320-0x327,0x32c-0x32f irq 11 drq 5,7 on isa0
 Jul 15 14:29:56 test /kernel: pcm0: <GUS CS4231> on gusc0
 Jul 15 14:29:56 test /kernel: gusc1: <Gravis UltraSound Plug & Play OPL> at port 0x388-0x389 irq 5 drq 1 on isa0
 Jul 15 14:29:56 test /kernel: gusc2: <Gravis UltraSound Plug & Play MIDI> at port 0x330 on isa0
 Jul 15 14:29:56 test /kernel: midi1: <GUS Midi Interface> on gusc2
 Jul 15 14:29:56 test /kernel: device_probe_and_attach: midi1 attach returned 6
 
 And:
 
 bash-2.03$ cat /dev/sndstat
 FreeBSD Audio Driver (newpcm) Jul 15 2000 13:51:33
 Installed devices:
 pcm0: <GUS CS4231> at io 0x32c irq 11 drq 7:5 (1p/1r channels duplex)
 
 
 -- 
 Richard Seaman, Jr.        email:    dick@tar.com
 5182 N. Maple Lane         phone:    262-367-5450
 Nashotah WI 53058            fax:    262-367-5852
 

From: "Louis A. Mamakos" <louie@TransSys.COM>
To: "Richard Seaman, Jr." <dick@tar.com>
Cc: tanimura@FreeBSD.ORG, FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: kern/19945: panic: nexus_setup_intr: NULL irq resource with GUS PnP 
Date: Sat, 15 Jul 2000 17:38:14 -0400

 > Ok.  I never tried the kld since I had pcm in my kernel config.  BTW, I don't seem
 > to need "device snd" or "device gusc" in my kernel config, only
 > 
 > device pcm
 
 Yup, brain fart; I meant pcm instead of snd.  I pulled it all out of
 my config while I was trying to get a kernel to boot.
 
 I rebooted, and re-made the devices.  The GuS /dev/dsp0 device seems to 
 be working just fine, essentially as before.  I'm getting what I expect
 now out of /dev/sndstat, too.
 
 > It still seems to find gusc just fine.  Since my message I also added:
 > 
 > device		midi
 > device		seq
 
 Yes, just did that too.  I'll see how it feels about it next time I
 boot.
 
 Thanks very much for the patch; this seems to fix my problem and likely
 should be commited.
 
 louie
 
Responsible-Changed-From-To: freebsd-bugs->dick 
Responsible-Changed-By: sheldonh 
Responsible-Changed-When: Mon Jul 17 10:20:46 PDT 2000 
Responsible-Changed-Why:  
Richard's the man with the patch.  Richard, will you need to run 
it by Cameron, or are you also involved? 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19945 
State-Changed-From-To: open->		 closed           
State-Changed-By: dick 
State-Changed-When: Tue Jul 18 13:20:59 PDT 2000 
State-Changed-Why:  
Patch committed. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=19945 
>Unformatted:
