From owner-freebsd-net@FreeBSD.ORG Wed Jun 7 17:20:55 2006 Return-Path: X-Original-To: freebsd-net@freebsd.org Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E63F916A675; Wed, 7 Jun 2006 14:47:28 +0000 (UTC) (envelope-from sem@freebsd.org) Received: from relay1.beelinegprs.ru (relay1.beelinegprs.ru [217.118.71.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E4E243D48; Wed, 7 Jun 2006 14:47:28 +0000 (GMT) (envelope-from sem@freebsd.org) Received: from relay1 (localhost [127.0.0.1]) by relay1 (Postfix) with SMTP id BDD7A36D30; Wed, 7 Jun 2006 18:44:13 +0400 (MSD) Received: from [172.19.248.43] (clusterfw.beelinegprs.net [217.118.66.232]) by relay1.beelinegprs.ru (Postfix) with ESMTP id 2C97636D2B; Wed, 7 Jun 2006 18:44:10 +0400 (MSD) Message-ID: <4486E632.3080204@FreeBSD.org> Date: Wed, 07 Jun 2006 18:44:02 +0400 From: Sergey Matveychuk User-Agent: Thunderbird 1.5.0.2 (X11/20060429) MIME-Version: 1.0 To: Andrew Thompson References: <20060606232543.GB14303@heff.fud.org.nz> In-Reply-To: <20060606232543.GB14303@heff.fud.org.nz> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Spamtest-Info: License expired Cc: freebsd-net@freebsd.org Subject: Re: Sleeping in USB network drivers X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 07 Jun 2006 17:21:00 -0000 Andrew Thompson wrote: > Hi, > > > I am looking into the reported panics with the if_aue driver and have > come across a locking problem with usb adapters that is not obvious how > to fix. > > The problem is that usbd_do_request() may sleep and most drivers are > careful to call it without any locks held. in_addmulti() will grab > in_multi_mtx before calling if_addmulti() to update the cards multicast > hash, this effectively means that the driver can not sleep in > *_setmulti but this is unavoidable with USB. > > Does anyone have any suggestions? (panic and bt below) It was discussed in usb@. Shortly, USB stack should be rewritten. The patch can be found at http://www.turbocat.net/~hselasky/usb4bsd/index.html -- Dixi. Sem.