Date: Mon, 8 Apr 2002 18:59:52 +0100 From: Josef Karthauser <joe@tao.org.uk> To: John Baldwin <jhb@FreeBSD.org> Cc: David Wolfskill <david@catwhisker.org>, current@freebsd.org Subject: Re: panic "sleeping without a mutex" in usb_task_thread Message-ID: <20020408175952.GA83305@genius.tao.org.uk> In-Reply-To: <XFMail.20020408123340.jhb@FreeBSD.org> References: <200204081558.g38FwmFg049414@bunrab.catwhisker.org> <XFMail.20020408123340.jhb@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--tThc/1wpZn/ma/RB Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Apr 08, 2002 at 12:33:40PM -0400, John Baldwin wrote: =20 > show witness isn't useful to most people so I would avoid it unless someo= ne > 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: Index: usb.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D 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; =20 +#ifdef __FreeBSD__ + mtx_lock(&Giant); +#endif + DPRINTF(("usb_task_thread: start\n")); =20 s =3D splusb(); for (;;) { task =3D TAILQ_FIRST(&usb_all_tasks); Joe --tThc/1wpZn/ma/RB Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjyx2pgACgkQXVIcjOaxUBb0hQCgiQQ9Gt1m8irSLpzrLWlT41CB RwAAn03W5saUdVDyDeJRaqdliLuvV2Qd =9pxK -----END PGP SIGNATURE----- --tThc/1wpZn/ma/RB-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020408175952.GA83305>