Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Sep 1996 23:06:11 -0400
From:      "Louis A. Mamakos" <louie@TransSys.COM>
To:        hasty@rah.star-gate.com, multimedia@freebsd.org
Subject:   guspnp3 panics on my -current system
Message-ID:  <199609300306.XAA00358@whizzo.transsys.com>
In-Reply-To: Your message of "Sun, 29 Sep 1996 20:47:40 EDT." <Pine.BSI.3.95.960929203611.725B-100000@moonpie.w8hd.org> 
References:  <Pine.BSI.3.95.960929203611.725B-100000@moonpie.w8hd.org> 

next in thread | previous in thread | raw e-mail | index | archive | help

I've always had lingering problems with my GUS PnP on my system; occasionally
the system spontaneously reboots.  I thought with this latest discussion,
I'd dig into it a little more to find out what the problem was.

I started to try to use the sound driver from the console (rather than
a xterm) to see just what's going on.  It seems a little more obvious
to me now what's happening.

I provoked the sound driver from single-user mode by doing

	cat /bin/cat > /dev/audio

I'm getting a "panic: isa_dmastart: bad bounce buffer".  I finally
managed to get a good core dump of the system and here's what I see;
ignore the first few stack frames which is the reboot invoked from
DDB.

(kgdb) where
#0  boot (howto=260) at ../../kern/kern_shutdown.c:237
#1  0xf0114433 in panic (fmt=0x0) at ../../kern/kern_shutdown.c:361
#2  0xf01015ae in db_fncall (dummy1=-272630708, dummy2=0, dummy3=-266287552, 
    dummy4=0xefbffc08 "\n") at ../../ddb/db_command.c:535
#3  0xf01012e5 in db_command (last_cmdp=0xf01fcb24, cmd_table=0xf01fc974, 
    aux_cmd_tablep=0xf021eca0) at ../../ddb/db_command.c:333
#4  0xf0101462 in db_command_loop () at ../../ddb/db_command.c:458
#5  0xf0103c18 in db_trap (type=3, code=0) at ../../ddb/db_trap.c:73
#6  0xf01c404b in kdb_trap (type=3, code=0, regs=0xefbffcf8)
    at ../../i386/i386/db_interface.c:126
#7  0xf01cd510 in trap (frame={tf_es = 16, tf_ds = 16, tf_edi = 32768, 
      tf_esi = -266522255, tf_ebp = -272630468, tf_isp = -272630496, 
      tf_ebx = 256, tf_edx = -266583543, tf_ecx = -1, tf_eax = 18, 
      tf_trapno = 3, tf_err = 0, tf_eip = -266583487, tf_cs = 8, 
      tf_eflags = 582, tf_esp = -266583559, tf_ss = -267303992})
    at ../../i386/i386/trap.c:403
#8  0xf01c51c1 in calltrap ()
#9  0xf011442a in panic (fmt=0xf01d3171 "isa_dmastart: bad bounce buffer")
    at ../../kern/kern_shutdown.c:359
#10 0xf01d31fa in isa_dmastart (flags=524288, addr=0xf1cea000 "\221", 
    nbytes=32768, chan=7) at ../../i386/isa/isa.c:662
#11 0xf01ddd3e in DMAbuf_start_dma (dev=0, physaddr=4056850432, count=4096, 
    dma_mode=1) at ../../i386/isa/sound/dmabuf.c:1211
#12 0xf01eb352 in ad1848_output_block (dev=0, buf=4056850432, count=4096, 
    intrflag=0, dma_restart=1) at ../../i386/isa/sound/ad1848.c:907
#13 0xf01ddc9e in DMAbuf_start_output (dev=0, buff_no=0, l=4096)
    at ../../i386/isa/sound/dmabuf.c:1152
#14 0xf01dbf47 in audio_write (dev=0, file=0xf021b0a4, buf=0xefbfff34, 
    count=16384) at ../../i386/isa/sound/audio.c:276
#15 0xf01db80d in sound_write_sw (dev=4, file=0xf021b0a4, buf=0xefbfff34, 
    count=16384) at ../../i386/isa/sound/sound_switch.c:389
#16 0xf01da66c in sndwrite (dev=7684, buf=0xefbfff34, flag=0)
    at ../../i386/isa/sound/soundcard.c:183
#17 0xf013f5da in spec_write (ap=0xefbffee8)
    at ../../miscfs/specfs/spec_vnops.c:339
#18 0xf01b070c in ufsspec_write (ap=0xefbffee8)
    at ../../ufs/ufs/ufs_vnops.c:1878
#19 0xf0137db7 in vn_write (fp=0xf1de48c0, uio=0xefbfff34, cred=0xf1dc1500)
    at vnode_if.h:283
#20 0xf011b7f3 in write (p=0xf1dd9000, uap=0xefbfff94, retval=0xefbfff84)
    at ../../kern/sys_generic.c:263
#21 0xf01cdf4b in syscall (frame={tf_es = 39, tf_ds = 39, tf_edi = 1, 
      tf_esi = 0, tf_ebp = -272638688, tf_isp = -272629788, tf_ebx = 16384, 
      tf_edx = 3, tf_ecx = 13, tf_eax = 4, tf_trapno = 12, tf_err = 7, 
      tf_eip = 32325, tf_cs = 31, tf_eflags = 518, tf_esp = -272638812, 
      tf_ss = 39}) at ../../i386/i386/trap.c:891
#22 0xf01c5215 in Xsyscall ()
#23 0x18e7 in ?? ()
#24 0x1316 in ?? ()
#25 0x107f in ?? ()

If you look in the neighborhood of the panic:
(kgdb) list
657		dma_busy |= (1 << chan);
658	
659		if (isa_dmarangecheck(addr, nbytes, chan)) {
660			if (dma_bouncebuf[chan] == NULL
661			    || dma_bouncebufsize[chan] < nbytes)
662				panic("isa_dmastart: bad bounce buffer"); 
663			dma_bounced |= (1 << chan);
664			newaddr = dma_bouncebuf[chan];
665	
666			/* copy bounce buffer on write */

(kgdb) p dma_bouncebuf
$6 = {0x0, 0x0, 0xf1986400 "", 0x0, 0x0, 0x0, 0x0, 0x0}
(kgdb) p chan
$7 = 7
(kgdb) p dma_bouncebufsize
$8 = {0, 0, 1024, 0, 0, 0, 0, 0}
(kgdb)

Well, it seems pretty obvious that a bounce buffer was never setup for
DMA channel 7 (which, along with channel 5) is used by the GUS PnP board.
The only bounce buffer initialized is for DMA channel 2, for the floppy
disk controller.

For completeness:

(kgdb) p addr
$9 = 0xf1cea000 "\221"
(kgdb) p nbytes
$10 = 32768
(kgdb) 

I looked high and low, but didn't see any place where isa_dmainit is called
to initialize the bounce buffer for the DMA channels used by the GUS. 
How does this ever work on systems with greater than 16MB of memory?  Is
there some mechanism which is supposed to allocate DMA friendly memory
for the sound driver's use?

I'm running a -current kernel that's based on code a day or two old.  The
kernel config for the GUS board is:

controller	snd0
device gus0 at isa? port 0x220 irq 11 drq 5 flags 0x7 vector gusintr

Any pointers would be very much appreciated.  I have the core dump file
and kernel image around, so I can grovel around for any additional 
information as required.  I really would like to get good,
reliable sound running on this system...

Louis Mamakos





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199609300306.XAA00358>