From owner-freebsd-hackers@FreeBSD.ORG Mon May 10 07:27:07 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEBB416A4CE for ; Mon, 10 May 2004 07:27:07 -0700 (PDT) Received: from mail5.speakeasy.net (mail5.speakeasy.net [216.254.0.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7859243D48 for ; Mon, 10 May 2004 07:27:07 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: (qmail 7256 invoked from network); 10 May 2004 14:27:06 -0000 Received: from dsl027-160-063.atl1.dsl.speakeasy.net (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) encrypted SMTP for ; 10 May 2004 14:27:06 -0000 Received: from 10.50.40.205 (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.12.11/8.12.11) with ESMTP id i4AEQxkd097487; Mon, 10 May 2004 10:27:00 -0400 (EDT) (envelope-from jhb@FreeBSD.org) From: John Baldwin To: freebsd-hackers@FreeBSD.org Date: Mon, 10 May 2004 10:27:25 -0400 User-Agent: KMail/1.6 References: <200405091941.i49Jev7E096965@gw.catspoiler.org> In-Reply-To: <200405091941.i49Jev7E096965@gw.catspoiler.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200405101027.25456.jhb@FreeBSD.org> X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on server.baldwin.cx cc: junior@p233.if.pwr.wroc.pl cc: Don Lewis Subject: Re: non-recursive mutex, sbc, pcm, kernel panic X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 May 2004 14:27:08 -0000 On Sunday 09 May 2004 03:40 pm, Don Lewis wrote: > Typically the proper fix in this case would be to remove the > sb_lock() call from sb_reset_dsp() and always let the caller do the > locking. The patch below should do the trick, though I believe the > added locking and unlocking (the second section of the patch) could be > omitted in sb16_attach() since no other thread can access the device > while the attach is in progress. Just a nit: I would add an assertion that the lock is held when sb_reset_dsp() is called as both documentation and to ensure that all callers hold it during testing and future development. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org