[Q] USB urb completion handler

loody miloody at gmail.com
Wed May 23 21:44:40 EDT 2012


hi:

2012/5/23 Ezequiel Garcia <elezegarcia at gmail.com>:
> Hi,
>
>>> Bingo! Because the driver will only submit *one* urb at a time,
>>> how could it possible have more than one completion handlers
>>> called at a time?
>>
>> how about multi-thread try to send urbs on the same pipe with the same
>> complete function?
>
> Actually, I was wrong because my driver (being a video capture driver)
> submits several
> isoc urbs at the same time.
>
> I'm still not sure how this works regarding concurrency, but I guess
> (or hope) the usb core calls
> the completion handler one at a time OR the device sends interrupts
> one at a time for each urb.
take multi-core system for example, it is possible your completion
handler execute at the same time, except you add a spin lock for
activating your completion function.


>
> I know it's a terrible thing for me to guess (or hope), but these days
> I've been testing
> the driver under several conditions and it seems to work fine.
> So I'm not worrying too much.
>
> If someone more knowledgeable reads this and can put a light upon this issue,
> I would appreciate it.
>
> loody: Thanks for your answer regarding context ;)
> Ezequiel.



-- 
Regards,



More information about the Kernelnewbies mailing list