From owner-p4-projects@FreeBSD.ORG Fri Jul 11 10:33:55 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6716D1065670; Fri, 11 Jul 2008 10:33:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2A87F106564A; Fri, 11 Jul 2008 10:33:55 +0000 (UTC) (envelope-from hselasky@freebsd.org) Received: from swip.net (mailfe08.swip.net [212.247.154.225]) by mx1.freebsd.org (Postfix) with ESMTP id 9629E8FC1C; Fri, 11 Jul 2008 10:33:54 +0000 (UTC) (envelope-from hselasky@freebsd.org) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=3C3n4WwJvvEA:10 a=NMGBx6iLSXY/3qZKdJo9Bw==:17 a=6I5d2MoRAAAA:8 a=RB9RYbQKpP2xf7WVm7AA:9 a=SsF9FyHBCaC4oAshYkwA:7 a=v_OohS2Hzn0qvq21a5bMt357DhsA:4 a=SV7veod9ZcQA:10 a=LY0hPdMaydYA:10 Received: from [62.113.135.207] (account mc467741@c2i.net [62.113.135.207] verified) by mailfe08.swip.net (CommuniGate Pro SMTP 5.2.4b) with ESMTPA id 1001476054; Fri, 11 Jul 2008 11:33:50 +0200 From: Hans Petter Selasky To: Alexander Leidinger Date: Fri, 11 Jul 2008 08:59:52 +0200 User-Agent: KMail/1.9.7 References: <200807100757.m6A7vbex060400@repoman.freebsd.org> <20080711080514.92125k684wobbhgk@webmail.leidinger.net> In-Reply-To: <20080711080514.92125k684wobbhgk@webmail.leidinger.net> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807110859.54203.hselasky@freebsd.org> Cc: Perforce Change Reviews , ariff@freebsd.org Subject: Re: PERFORCE change 144991 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jul 2008 10:33:55 -0000 On Friday 11 July 2008, Alexander Leidinger wrote: > Quoting Hans Petter Selasky (from Thu, 10 Jul > > 2008 07:57:37 GMT): > > http://perforce.freebsd.org/chv.cgi?CH=144991 > > > > Change 144991 by hselasky@hselasky_laptop001 on 2008/07/10 07:56:37 > > > > > > These patches into the USB sound system are needed to make > > the Giant-free USB audio driver work seamlessly. > > If the mixer uninit can sleep, there's the possibility for a race, > isn't it? How do you make sure there's no race after not locking the > mixer? > > What about a different approach: > - keep the generic sound code as it is (locking of the mixer) > - add some uninit flag to the mixer private data > - check the flag > + if it is not set on uninit, set it > + if it is set on uninit (and maybe other mixer operations), abort > - unlock the mutex in the uninit > - do what can sleep > - lock the mutex > - return > > Bye, > Alexander. Detach and uninit routines should always be allowed to sleep in my opinion. Ariff: Is there any reason for keeping the mixer lock locked accross the UNINIT routine? I think this was done unintentionally. --HPS