On Monday 23 September 2002 02:52 pm, Oliver Neukum wrote:
> Am Dienstag, 17. September 2002 19:44 schrieb David Brownell:
> > > If I unlink my urbs upon disconnect synchronously and resubmit my urbs
> > > in the completon handler, is there a race condition between the two?
> >
> > Don't EVER submit another urb after you've gotten a disconnect()
> > callback -- that'd be a bug in your driver.  Your disconnect logic
> > needs to arrange (first thing!) that no more urbs get submitted.
>
> There's quite subtle a problem here.
> In principle disconnect() is not SMP-safe at present by design.
> Or to be be extremely pedantic either disconnect() or unlink() is not
> SMP-safe by design.
>
> We discussed this several months back.
> To summarise:
>
> After disconnect()  a device must be absolutely dead,
> head cut off and stuffed with garlic. In particular
> you must not be executing any driver code after returning from
> disconnect() because you may now face module unload.


This brings up a further question. Do you decrement the driver use counter 
upon disconnect or upon a release? If one chooses to decrement it when the 
last program gives up the last open file descriptor, the problem of unloading 
after a disconnect is no more. Is this right?


Anton


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to