From owner-freebsd-current Mon Apr 8 11:37:59 2002 Delivered-To: freebsd-current@freebsd.org Received: from mail11.speakeasy.net (mail11.speakeasy.net [216.254.0.211]) by hub.freebsd.org (Postfix) with ESMTP id 6250837B416 for ; Mon, 8 Apr 2002 11:37:52 -0700 (PDT) Received: (qmail 15728 invoked from network); 8 Apr 2002 18:37:50 -0000 Received: from unknown (HELO server.baldwin.cx) ([216.27.160.63]) (envelope-sender ) by mail11.speakeasy.net (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for ; 8 Apr 2002 18:37:50 -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 g38Icgv45619; Mon, 8 Apr 2002 14:38:42 -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: <20020408175952.GA83305@genius.tao.org.uk> Date: Mon, 08 Apr 2002 13:37:55 -0400 (EDT) From: John Baldwin To: Josef Karthauser Subject: Re: panic "sleeping without a mutex" in usb_task_thread Cc: current@freebsd.org, David Wolfskill 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 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. > Index: usb.c > =================================================================== > RCS file: /home/ncvs/src/sys/dev/usb/usb.c,v > retrieving revision 1.75 > diff -u -5 -r1.75 usb.c > --- usb.c 7 Apr 2002 14:21:32 -0000 1.75 > +++ usb.c 8 Apr 2002 17:58:38 -0000 > @@ -423,10 +423,14 @@ > usb_task_thread(void *arg) > { > struct usb_task *task; > int s; > > +#ifdef __FreeBSD__ > + mtx_lock(&Giant); > +#endif > + > DPRINTF(("usb_task_thread: start\n")); > > s = splusb(); > for (;;) { > task = TAILQ_FIRST(&usb_all_tasks); > > > 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