From owner-freebsd-current Mon Apr 8 11: 1:25 2002 Delivered-To: freebsd-current@freebsd.org Received: from tao.org.uk (genius.tao.org.uk [212.135.162.51]) by hub.freebsd.org (Postfix) with ESMTP id E46CD37B41A; Mon, 8 Apr 2002 11:00:55 -0700 (PDT) Received: by tao.org.uk (Postfix, from userid 100) id BB1B05A8; Mon, 8 Apr 2002 18:59:52 +0100 (BST) Date: Mon, 8 Apr 2002 18:59:52 +0100 From: Josef Karthauser To: John Baldwin Cc: David Wolfskill , current@freebsd.org Subject: Re: panic "sleeping without a mutex" in usb_task_thread Message-ID: <20020408175952.GA83305@genius.tao.org.uk> Mail-Followup-To: Josef Karthauser , John Baldwin , David Wolfskill , current@freebsd.org References: <200204081558.g38FwmFg049414@bunrab.catwhisker.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="tThc/1wpZn/ma/RB" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i 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 --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