On Sat, 26 Jul 2003, Johannes Erdfelt wrote: > On Sat, Jul 26, 2003, Alan Stern <[EMAIL PROTECTED]> wrote: > > > Eliminate the complete_list as well. When an URB completes, just > > call uhci_finish_urb() instead of uhci_add_complete(). Unlinked URBs can > > be passed to uhci_finish_urb() as they get processed in the > > urb_remove_list. > > Be careful! The reason why complete_list was added was to fix a deadlock > with the completion handler. > > The completion handler for the URB can submit an URB. As a result, we > have to be careful which locks we hold when we call the callback. In > particular, we can't hold urb_list_lock. > > I'll add some documentation for that :)
An excellent point. I'll remember to watch for that when I get around to working on it. > > The processing in uhci_transfer_result() could be speeded up a > > little by keeping some extra state in urbp. Keep track of the first > > active TD, and scan the list of TD's starting from there instead of from > > the beginning. That will be a big help especially for iso. transfers, > > since it will avoid scanning the same completed TDs over and over again. > > It also presents the possibility of unlinking iso. TDs as they complete, > > rather than waiting for the entire URB to finish. That could be the > > solution to the problem of iso. URBs that try to schedule transfers more > > than 1024 frames in the future. As each TD completes, unlink it and then > > see if it can be added back in to take care of a descriptor that was too > > far in the future originally but is okay now. > > We'd have to set the IOC bit on all (or some) of the ISO TDs then. This > isn't a big deal. We don't need to set every one and as long as we space > them out time wise, it should be acceptable. Yes. Maybe no more often than 10 per second. > On the other hand, I'm not sure if any drivers will submit more than 1 > seconds worth of transfers. That's a long time. To tell the truth, I have no idea what the drivers do. > I have no problems with tracking the first active TD. This will help for > large bulk transfers as well. I think it has been discussed in the past. > > We should also look at queuing Interrupt TDs with a QH head. I think > that may simplify code a bit too. Another change that might simplify things would be to use QHs only at the beginning of a queue, not in the middle. I think OHCI works that way. > I'd like to get the correctness fixes done first and then we can work on > optimizations and code cleanups. A very reasonable approach. Alan Stern ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ [EMAIL PROTECTED] To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel