I'm having problems unlinking in my device driver.
My driver submits a number of IN urbs on device open (up to 16) and simply appends data in a buffer in the callback function before re-submitting another urb (not the same one - an 'idle' one).
However, when closing the device and attempting to unlink the urbs, I am getting kernel panics. Sometimes they occur on close (unlink), and other times on module exit (probably on free_urb).
Are there any known race conditions in usb_unlink_urb()? (I saw reference to one in passing in a msg on this mailing list)
I've seen plenty of code that checks urb->status == -EINPROGRESS then unlinks if required - but IMHO that's pretty susceptible to race conditions?!? FWIW I'm using SYNC unlinking.
Is there a good example of how to unlink a number of outstanding urbs when using a callback to re-submit? It may be worth mentioning that if I unlink -EINPROGRESS urbs and simply wait for 2s in my close() function, then my panics disappear. I've been fiddling with flagging shutdown and outstanding urbs and counting down but still have race issues...
Any tips would be appreciated! Regards,
-- | Mark McDougall | | Software Engineer | | Cybertec Pty Ltd |
------------------------------------------------------- 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
