On Wednesday 16 January 2002 01:33, Matthew Dharm wrote:
> hrm.. I know I shouldn't jump in to something like this late, but...
>
> I'm starting to agree with Alan Cox. The problem with Oliver's suggestion
> below (keep a reference to a submitted URB) is that I still don't know when
> it's safe to free such a beast.
After the complition handler has returned or the HCD is finished
with doing to the urb what ever it may want to do after the complition
handler has returned.
Then there's only one reference (unless the complition handler
has resubmitted). That reference the driver holds and can drop it.
There might be a very small race, if the complition handler
wakes the driver, but that can be solved by the driver setting a flag
that indicates that the urb should be freed when the count reaches zero.
The actual freeing is done as the HCD drops its reference.
There's a simple concept, but to implement it the complition
handler must not be allowed to simply give the urb to kfree.
Regards
Oliver
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel