On Wed, Mar 13, 2002 at 11:55:35AM +0530, V Ganesh wrote:
> > On Tue, Mar 12, 2002 at 06:39:52PM +0530, V Ganesh wrote:
> > > I'm halfway through. this is the approach I'm using, please comment:
> > > 1. all *_callback() functions must use GFP_ATOMIC.
> > 
> > Good.
> > 
> > > 2. anything inside a spinlock must use GFP_ATOMIC.
> > 
> > No, we should not be calling usb_submit_urb() with a spinlock held.
> > Which usb-serial driver is doing this?
> 
> ipaq. mea culpa, I'll fix it.

Thanks.

> also digi_accelport.c where practically all urbs are submitted holding a
> spinlock.

I haven't looked in depth at the digi_accelport driver in quite some
time.  This should probably be changed in the 2.4 and 2.2 versions of
the driver at the least.

> > > 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.
> > 
> > What would cause it to be called from a bottom half?  The pppd driver?
> > For some reason I thought this had been changed.
> 
> I don't know much about ppp, but strace of pppd shows it completely
> idle and waiting on a select() throughout the entire session (except the lcp
> bits). I thought this implied all packets were sent/received in bh/irq context. 
> in any case, I don't think it's right for a low-level driver to constrain
> what the ldisc may do. e.g. an ldisc might echo characters, and this would
> happen immediately in the read_callback() context because many drivers call
> tty_flip_buffer_push().
> 
> so the only question seems to be to use GFP_ATOMIC or ALLOC_FLAGS.

GFP_ATOMIC sounds good to me, anyone else with an opinion?
This will also "solve"[1] the problem of people with a swap partition
mounted on a NFS partition over ppp through a usb-serial connection.

thanks,

greg k-h

[1] people doing this need more than this simple solution for their
    problems :)

_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to