Can we block in USB_ATTACH context ?

M. Warner Losh imp at bsdimp.com
Sun Mar 20 09:04:06 PST 2005


In message: <200503201517.33598.sebastien.b at swissinfo.org>
            Sebastien B <sebastien.b at 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


More information about the freebsd-usb mailing list