From owner-freebsd-current@FreeBSD.ORG Wed Dec 3 09:00:07 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 60DD616A4CE for ; Wed, 3 Dec 2003 09:00:07 -0800 (PST) Received: from hak.cnd.mcgill.ca (hak.cnd.mcgill.ca [132.216.11.133]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4632543FCB for ; Wed, 3 Dec 2003 09:00:04 -0800 (PST) (envelope-from mat@hak.cnd.mcgill.ca) Received: from hak.cnd.mcgill.ca (localhost [127.0.0.1]) by hak.cnd.mcgill.ca (8.12.9/8.12.8) with ESMTP id hB3GvJ15069296; Wed, 3 Dec 2003 11:57:19 -0500 (EST) (envelope-from mat@hak.cnd.mcgill.ca) Received: (from mat@localhost) by hak.cnd.mcgill.ca (8.12.9/8.12.8/Submit) id hB3GvJ0A069295; Wed, 3 Dec 2003 11:57:19 -0500 (EST) Date: Wed, 3 Dec 2003 11:57:19 -0500 From: Mathew Kanner To: Sean Chittenden Message-ID: <20031203165719.GL54011@cnd.mcgill.ca> References: <20031203060710.GJ54011@cnd.mcgill.ca> <20031203090426.GH16547@perrin.nxad.com> <20031203091401.GA688@perrin.nxad.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="b5gNqxB1S1yM7hjW" Content-Disposition: inline In-Reply-To: <20031203091401.GA688@perrin.nxad.com> User-Agent: Mutt/1.4.1i Organization: I speak for myself, operating in Montreal, CANADA X-Spam-Status: No, hits=0.0 required=5.0 tests=none autolearn=no version=2.60 X-Spam-Checker-Version: SpamAssassin 2.60 (1.212-2003-09-23-exp) on hak.cnd.mcgill.ca cc: Jesse Guardiani cc: freebsd-current@FreeBSD.org Subject: Re: please test pcm channel patch X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Dec 2003 17:00:07 -0000 --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Dec 03, Sean Chittenden wrote: > > > Hello All, > > > Please test this PCM patch. It creates seperate locking > > > classes for PCM channels and should prevent the warning where > > > multiple mutexes from the same class are held (as reported > > > recently). I believe this to be a good strategy as it masks fewer > > > errors. > > > > I can confirm that this patch fixes my LOR for pcm(4). -sc > > Bah! I got 30min into playing tunes and picked the same LOR up not > more than 5min after sending this. :( Sorry for the false alarm. > > acquiring duplicate lock of same type: "pcm record channel" > 1st pcm0:record:0 @ /usr/src/sys/dev/sound/pcm/dsp.c:144 > 2nd pcm0:play:0 @ /usr/src/sys/dev/sound/pcm/dsp.c:146 > Stack backtrace: Sean, I found the mistake, I assumed that a variable was initialized when it wasn't. Sorry for asking you to test a stupid patch before. Please try this one. Thanks again, --Mat -- Having your book made into a movie is like having your ox made into a bouillon cube. - Bill Neely --b5gNqxB1S1yM7hjW Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="channel_lor2.patch" Index: channel.c =================================================================== RCS file: /home/ncvs/src/sys/dev/sound/pcm/channel.c,v retrieving revision 1.92 diff -u -r1.92 channel.c --- channel.c 27 Nov 2003 19:51:44 -0000 1.92 +++ channel.c 3 Dec 2003 16:55:41 -0000 @@ -67,9 +67,12 @@ static int chn_buildfeeder(struct pcm_channel *c); static void -chn_lockinit(struct pcm_channel *c) +chn_lockinit(struct pcm_channel *c, int dir) { - c->lock = snd_mtxcreate(c->name, "pcm channel"); + if (dir == PCMDIR_PLAY) + c->lock = snd_mtxcreate(c->name, "pcm play channel"); + else + c->lock = snd_mtxcreate(c->name, "pcm record channel"); } static void @@ -736,7 +739,7 @@ struct snd_dbuf *b, *bs; int ret; - chn_lockinit(c); + chn_lockinit(c, dir); b = NULL; bs = NULL; --b5gNqxB1S1yM7hjW--