Am Freitag, 10. Januar 2003 22:16 schrieb Duncan Sands: > Hi Oliver, I decided to see how other drivers deal with this usb_unlink_urb > issue. The first thing I looked was devio.c. And guess what, it looks > like it assumes that the completion handler has completed by the time > usb_unlink_urb finishes: > > static void destroy_async (struct dev_state *ps, struct list_head *list) > { > struct async *as; > unsigned long flags; > > spin_lock_irqsave(&ps->lock, flags); > while (!list_empty(list)) { > as = list_entry(list->next, struct async, asynclist); > list_del_init(&as->asynclist); > spin_unlock_irqrestore(&ps->lock, flags); > /* usb_unlink_urb calls the completion handler with status > == -ENOENT */ usb_unlink_urb(as->urb); > spin_lock_irqsave(&ps->lock, flags); > } > spin_unlock_irqrestore(&ps->lock, flags); > while ((as = async_getcompleted(ps))) <=== assumes completion > handler finished before this call free_async(as); > > Hmm, I wonder what the chances are that the next driver I look at > suffers from the same kind of problem.
That are good, or bad depending on viewpoint. IIRC we had this discussion already, possibly several times. Has the general consensus changed ? It seems that the old objections about freeing the URB from the completion handler are no longer valid, due to reference counting. IMO the completion handler should be waited for. Regards Oliver ------------------------------------------------------- This SF.NET email is sponsored by: SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See! http://www.vasoftware.com _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel