From nobody@FreeBSD.org  Wed Mar  7 21:24:40 2001
Return-Path: <nobody@FreeBSD.org>
Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21])
	by hub.freebsd.org (Postfix) with ESMTP id 752A337B719
	for <freebsd-gnats-submit@FreeBSD.org>; Wed,  7 Mar 2001 21:24:40 -0800 (PST)
	(envelope-from nobody@FreeBSD.org)
Received: (from nobody@localhost)
	by freefall.freebsd.org (8.11.1/8.11.1) id f285Oel21924;
	Wed, 7 Mar 2001 21:24:40 -0800 (PST)
	(envelope-from nobody)
Message-Id: <200103080524.f285Oel21924@freefall.freebsd.org>
Date: Wed, 7 Mar 2001 21:24:40 -0800 (PST)
From: darkwalker@bigfoot.com
To: freebsd-gnats-submit@FreeBSD.org
Subject: Loading/unloading sound modules (snd_sb16) more than once makes errors
X-Send-Pr-Version: www-1.0

>Number:         25600
>Category:       kern
>Synopsis:       Loading/unloading sound modules (snd_sb16) more than once makes errors
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cg
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 07 21:30:00 PST 2001
>Closed-Date:    Sun Apr 8 14:27:46 PDT 2001
>Last-Modified:  Sun Apr 08 14:28:20 PDT 2001
>Originator:     michael lothian
>Release:        4.2-STABLE as of Mon Mar  5 18:35:55 PST 2001
>Organization:
none
>Environment:
FreeBSD stones.internal.dsmx.net 4.2-STABLE FreeBSD 4.2-STABLE #0: Mon Mar  5 18:35:55 PST 2001     root@stones.internal.dsmx.net:/usr/src/sys/compile/STONES  i386
>Description:
Loading a sound kld (snd_sb16 for instance), unloading it,
then loading and unloading it again causes a few errors
from the kernel. Every subsequent load/unload causes another error
on top of the ones that have already shown to appear again.
It seems to not release DMAs after acquiring them,
and not destroy children devices of the SB16 properly
on module unload

I have a K6-2 500 with an SB AWE64 Value, FreeBSD installed
about 2 days ago and upgraded to -STABLE w/ cvsup

dmesg output after load/unloading snd_sb16 3 times:
---
c0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 
1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
pcm0: detached
sbc0: detached
sbc0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
isa_dma_acquire: channel 1 already in use
isa_dma_acquire: channel 5 already in use
pcm1: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm1 attach returned 6
pcm0: detached
sbc0: detached
sbc0: <Creative SB AWE64> at port 0x220-0x22f,0x330-0x331,0x388-0x38b irq 5 drq 1,5 on isa0
pcm0: <SB16 DSP 4.16> on sbc0
isa_dma_acquire: channel 1 already in use
isa_dma_acquire: channel 5 already in use
pcm1: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm1 attach returned 6
pcm2: <SB16 DSP 4.16> on sbc0
device_probe_and_attach: pcm2 attach returned 6
pcm0: detached
sbc0: detached
---

>How-To-Repeat:
execute `kldload snd_sb16; kldunload snd_sb16` three times with a
sound blaster in the system (may work with other modules too)
>Fix:
This diff will get rid of the errors and fix what looks like
a typo in /sys/dev/sound/isa/sb16.c, but I'm not sure if they're
the right way to fix it (only been using freebsd 2 days :))

http://sync.dyndns.org/~walker/files/sbfix.diff

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->feedback 
State-Changed-By: kris 
State-Changed-When: Mon Mar 12 18:22:17 PST 2001 
State-Changed-Why:  
Problem may already be resolved 


Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: kris 
Responsible-Changed-When: Mon Mar 12 18:22:17 PST 2001 
Responsible-Changed-Why:  
cg is Mr Sound 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25600 

From: Kris Kennaway <kris@obsecurity.org>
To: darkwalker@bigfoot.com
Cc: freebsd-gnats-submit@FreeBSD.ORG
Subject: Re: kern/25600: Loading/unloading sound modules (snd_sb16) more than once makes errors
Date: Mon, 12 Mar 2001 18:23:01 -0800

 --lMM8JwqTlfDpEaS6
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 
 On Wed, Mar 07, 2001 at 09:24:40PM -0800, darkwalker@bigfoot.com wrote:
 
 > Loading a sound kld (snd_sb16 for instance), unloading it,
 > then loading and unloading it again causes a few errors
 > from the kernel. Every subsequent load/unload causes another error
 > on top of the ones that have already shown to appear again.
 > It seems to not release DMAs after acquiring them,
 > and not destroy children devices of the SB16 properly
 > on module unload
 
 PCM wasn't supported as modules in 4.x until very recently -- you may
 be predating that change. Can you update to the latest -stable
 (actually called 4.3-BETA) and try again?
 
 Kris
 
 --lMM8JwqTlfDpEaS6
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.0.4 (FreeBSD)
 Comment: For info see http://www.gnupg.org
 
 iD8DBQE6rYRVWry0BWjoQKURAhpEAJ9GIoKwO3aygI19N4ynsCZB8x5INgCg27H3
 p4geV4f16ymU69Pig2jOHXg=
 =OBe/
 -----END PGP SIGNATURE-----
 
 --lMM8JwqTlfDpEaS6--
State-Changed-From-To: feedback->closed 
State-Changed-By: greid 
State-Changed-When: Sun Apr 8 14:27:46 PDT 2001 
State-Changed-Why:  
Fixed 

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