From owner-freebsd-current Mon Apr 8 13:47:13 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail17.speakeasy.net (mail17.speakeasy.net [216.254.0.217]) by hub.freebsd.org (Postfix) with ESMTP id AC99337B416 for ; Mon, 8 Apr 2002 13:47:09 -0700 (PDT) Received: (qmail 4943 invoked from network); 8 Apr 2002 20:47:07 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail17.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 8 Apr 2002 20:47:07 -0000 Received: from laptop.baldwin.cx (gw1.twc.weather.com [216.133.140.1]) by server.baldwin.cx (8.11.6/8.11.6) with ESMTP id g38Klvv46131; Mon, 8 Apr 2002 16:47:57 -0400 (EDT) (envelope-from jhb@FreeBSD.org) Message-ID: X-Mailer: XFMail 1.5.2 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20020408183829.GB85649@genius.tao.org.uk> Date: Mon, 08 Apr 2002 16:47:00 -0400 (EDT) From: John Baldwin To: Josef Karthauser Subject: Re: panic "sleeping without a mutex" in usb_task_thread Cc: David Wolfskill , current@freebsd.org Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 08-Apr-2002 Josef Karthauser wrote: > On Mon, Apr 08, 2002 at 01:37:55PM -0400, John Baldwin wrote: >> >> On 08-Apr-2002 Josef Karthauser wrote: >> > On Mon, Apr 08, 2002 at 12:33:40PM -0400, John Baldwin wrote: >> > >> >> show witness isn't useful to most people so I would avoid it unless >> >> someone >> >> explicitly asks for it. The problem here is likely due to the >> >> usb_task_thread() not locking Giant when it starts up. >> > >> > We probably want this: >> >> Probably unless some USB specific locks are added instead, but this is the >> easier fix for the time being. >> > > Cool. I've committed this; where should I look to get a low down on > what to lock, when and how? Is there anything other than source to > refer to? Nothing besides the source really. If it's walking a list you might use a lock to protect the list for example, but then you might need to conditionally get Giant while performing an action on the list. > Joe -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message