Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 20 Mar 2005 10:04:17 -0700 (MST)
From:      "M. Warner Losh" <imp@bsdimp.com>
To:        sebastien.b@swissinfo.org
Cc:        freebsd-usb@freebsd.org
Subject:   Re: Can we block in USB_ATTACH context ?
Message-ID:  <20050320.100417.27675329.imp@bsdimp.com>
In-Reply-To: <200503201517.33598.sebastien.b@swissinfo.org>
References:  <200503201517.33598.sebastien.b@swissinfo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
In message: <200503201517.33598.sebastien.b@swissinfo.org>
            Sebastien B <sebastien.b@swissinfo.org> writes:
: Hello,
: Can I call functions that will block (ie. waiting for condition variables, 
: acquiring MTX_DEF mutexes, ...) inside the USB_ATTACH section of a driver ?
: Or should I use a software interrupt handler that will perform the 
: initialization of my USB device instead of doing this directly in 
: USB_ATTACH ? (Lots of transfers have to be made before the device is ready... 
: setting up the NET2280 PCI bridge, uploading a ~30kbyte firmware, reading 
: configuration options of the device...)

It is safe to block in usb_attach routines.  You will block all other
usb attachment activity, however.  I believe that other usb transfers
will continue, but haven't verified it.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050320.100417.27675329.imp>