USB2 patches

Andrew Thompson thompsa at FreeBSD.org
Sun Feb 1 20:24:55 PST 2009


On Sun, Feb 01, 2009 at 07:38:47PM +0100, Hans Petter Selasky wrote:
> On Sunday 01 February 2009, M. Warner Losh wrote:
> > In message: <200902011922.16810.hselasky at c2i.net>
> >
> >             Hans Petter Selasky <hselasky at c2i.net> writes:
> > : In your patch you remove all error checking! If the taskqueue system does
> > : not have an API function that can tell if the taskqueue is being drained
> > : from inside the taskqueue callback, the taskqueue system has to be
> > : modified! It cannot replace the existing system like it is now!
> >
> > Why does the taskqueue system need to provide that?  Why can't the
> > driver set a dying flag in the softc to communicate this fact to the
> > taskqueue tasks?
> 
> That's also possible. Thomas already made a "struct usb2_task" I think, where 
> this flag could be added.

I have been thinking about this more. The main issue is usb requests
timing out when the device is yanked, the udev structure should keep
state on this and set it as detached before calling the device detach
routine. This will allow usb requests that may be running in the
taskqueue to abort gracefully and taskqueue should drain quite easily.

If the device hasnt been yanked then it will have no issues draining as
the queued tasks will happily run to completion.


Andrew


More information about the freebsd-usb mailing list