> On Fri, Mar 08, 2002 at 06:59:57PM +0530, V Ganesh wrote: > > hi, > > I noticed that usb_submit_urb() is supposed to be used with a GFP > > flag, which ought to be GFP_ATOMIC if called from an interrupt handler or > > bottom half. however, a grep of GFP_ATOMIC in drivers/usb/serial/* in greg's > > 2.5 tree draws a total blank. I would have thought a function like > > visor_read_bulk_callback() should have used GFP_ATOMIC rather than GFP_KERNEL > > to resubmit the bulk read urb. could someone please clarify this? > > Like Oliver said, you are right. Want to make a patch to fix all of > drivers/usb/serial/* ? > > thanks, > > greg k-h
I'm halfway through. this is the approach I'm using, please comment: 1. all *_callback() functions must use GFP_ATOMIC. 2. anything inside a spinlock must use GFP_ATOMIC. 3. *_open(), *_startup(), *_set_termios() use GFP_KERNEL. 4. *_write(), *_unthrottle() can be called from user context as well as bottom half context. so I define a macro in usb-serial.h #define ALLOC_FLAGS (in_interrupt() ? GFP_ATOMIC : GFP_KERNEL) and use it in these functions. the alternative is to always do a GFP_ATOMIC. thanks, ganesh _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel