From owner-freebsd-usb@FreeBSD.ORG Sat Mar 26 23:18:55 2005 Return-Path: Delivered-To: freebsd-usb@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A72D116A4CE for ; Sat, 26 Mar 2005 23:18:55 +0000 (GMT) Received: from md1.swissinfo.org (md1.swissinfo.org [146.159.4.92]) by mx1.FreeBSD.org (Postfix) with ESMTP id E565643D39 for ; Sat, 26 Mar 2005 23:18:54 +0000 (GMT) (envelope-from sebastien.b@swissinfo.org) Received: from mail.swissinfo.org ([194.6.181.33]) by md1.swissinfo.org (phad1.swissinfo.org [146.159.6.9]) (MDaemon.PRO.v7.2.1.R) with ESMTP id 29-md50000370154.msg for ; Sun, 27 Mar 2005 00:22:14 +0100 Received: from AAmiens-152-1-36-150.w83-198.abo.wanadoo.fr (83.198.35.150) by mail.swissinfo.org (7.0.020) (authenticated as sebastien.b) id 4153942002C892B9; Sat, 26 Mar 2005 21:58:27 +0100 From: Sebastien B To: ticso@cicely.de Date: Sat, 26 Mar 2005 21:58:31 +0000 User-Agent: KMail/1.8 References: <200503261558.21943.sebastien.b@swissinfo.org> <20050326181317.GE14532@cicely12.cicely.de> In-Reply-To: <20050326181317.GE14532@cicely12.cicely.de> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200503262158.32320.sebastien.b@swissinfo.org> X-Spam-Processed: phad1.swissinfo.org, Sun, 27 Mar 2005 00:22:14 +0100 (not processed: message from valid local sender) X-MDRemoteIP: 194.6.181.33 X-Return-Path: sebastien.b@swissinfo.org X-MDaemon-Deliver-To: freebsd-usb@freebsd.org X-MDAV-Processed: phad1.swissinfo.org, Sun, 27 Mar 2005 00:22:17 +0100 cc: freebsd-usb@freebsd.org Subject: Re: What's the right way to wait for an USB transfer to complete ? X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Mar 2005 23:18:55 -0000 Hello, > > Locking the mutex in the software interrupt handler causes a kernel panic > > in propagate_priority (it seems to occur only when the mutex is already > > held by another thread, therefore mtx_lock() blocks) : > > > > Fatal trap 12: page fault while in kernel mode > > fault virtual address = 0x24 > > Likely you are using a NULL pointer as mutex. No, it is not NULL, the instruction I believe to have caused the fault is "mtx_lock(&sc->brg_rx.comp_mp)". "&sc->brg_rx.comp_mp" can't be NULL, AFAIK. You can have a look at my code, it's at http://yoshiyo.ath.cx/seb/download/prism54u-bsd-20050326.tar.bz2 See the "bottom halves" section of usb_transport.c > If you want your driver GIANT free that's fine, but don't forget > that calling USB layer requires you to acquire GIANT first. You mean I must hold Giant every time I call any USB function ? I've never seen any driver doing this... Regards, Sebastien