Bug 19945

Summary: panic: nexus_setup_intr: NULL irq resource with GUS PnP
Product: Base System Reporter: Louis Mamakos <louie>
Component: kernAssignee: dick
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 5.0-CURRENT   
Hardware: Any   
OS: Any   

Description Louis Mamakos 2000-07-15 06:40:01 UTC
After upgrading to a recent 5.0-current, system would panic upon
boot with 

	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
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!
Comment 1 dick 2000-07-15 19:26:06 UTC
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
Comment 2 Louis Mamakos 2000-07-15 21:59:21 UTC
> 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
Comment 3 dick 2000-07-15 22:23:41 UTC
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
Comment 4 Louis Mamakos 2000-07-15 22:38:14 UTC
> 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
Comment 5 Sheldon Hearn freebsd_committer freebsd_triage 2000-07-17 18:20:46 UTC
Responsible Changed
From-To: freebsd-bugs->dick

Richard's the man with the patch.  Richard, will you need to run 
it by Cameron, or are you also involved?
Comment 6 dick freebsd_committer freebsd_triage 2000-07-18 21:20:59 UTC
State Changed
From-To: open->		 closed

Patch committed.