On Mon, 1 Jul 2013, Ming Lei wrote: > On Sun, Jun 30, 2013 at 11:02 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote: > > Clement and Laurent: > > > > The two of you seem to be the people who make the most use of > > isochronous USB transfers. Since the ehci-hcd driver is being changed > > to use a tasklet for URB completion callbacks, it looks like I will > > need to reconsider how isochronous underruns get handled. > > Without using tasklet, the hard interrupt handler still can be delayed > for some time, and switching to tasklet doesn't change the fact of the > probable delay of URB handling. Yes. That wasn't the point. > > The problem will be more acute than in the past, because URB > > resubmissions will no longer be synchronous with URB completions, > > thanks to the tasklet. That is, in the current code, if the completion > > handler resubmits the URB, the resubmission occurs before the HCD > > finishes the completion callback. But in the new code, the HCD will > > simply hand the URB over to the tasklet, and the resubmission won't > > occur until some time later (when the tasklet wakes up and invokes the > > completion handler). As far as the HCD is concerned, the completion > > The delay should be very small(generally several microseconds) since > isochronous URBs are completed in high priority tasklet. The fact that the delay is small doesn't matter -- what's important is that it will be > 0 whereas now there is no delay between completion and resubmission (in fact, the resubmission occurs before the completion ends). > I don't think > the introduced tasklet delay is a problem for EHCI since per EHCI spec > the maximum rate at which the host controller will issue interrupts is one > microframe(125us), which means isochronous transfer completion can be > reported to CPU with about 125us delay in hardware level. Irrelevant. Besides, the delay can be longer than 125 us if another interrupt is being handled. > > Thus, for example, even if the pipeline contains only a single URB, > > with the current code it will not become empty. But with the new code > > it will. If the load on the system is too high, the pipeline could > > empty out even if it normally contains two or more URBs. > > Single URB may not work well too when running complete() in hard > irq context. It could work very well indeed, if the interval between URBs was larger than 1 ms. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html