Johannes Erdfelt wrote:

My brain wasn't functioning well. error_count has been in since 2.4.


It's just as broken in uhci.o.

In fact it seems like only ehci and the sl811hs code initialize it... two drivers, curiously enough, where the ISO code doesn't work so well.


This should probably go into the core since every HCD needs it to be set
to 0.

If we keep it, yes. But the only use of error_count seems to be in debug printk() calls ... is there a real reason to keep it around? Anyone who really needs it can count urbs for which urb->status != 0, it's clearly not necessary.


Here's an example. Suppose an iso. URB is submitted that has 5 descriptors and an interval of 300. Let's say the driver schedules the first descriptor for frame #100. Then looping through the descriptors, uhci_insert_td_frame_list() will be called 5 times and will store:

        td[0] in frame 100,
        td[1] in frame 400,
        td[2] in frame 700,
        td[3] in frame 1000, and
        td[4] in frame (1300 % 1024) = 276.

So the HC will transfer td[0] during frame 100, then td[4] during frame 276, then td[1] during frame 400, and so on. td[4] will be transferred at the wrong time; it shouldn't be sent until frame 276 _of the next loop_.


I see.

I think we should consider this a bogus request. Maybe we should return
an error if we see a driver submit an URB like this.

If it's bogus, yes return an error. Some new errno value.



If the calling driver wants to do this, submit it as 2 seperate requests
at the correct time.

It'd also be good to let USB device drivers know the biggest iso period that can be scheduled. It's not necessarily the same as the biggest interrupt period, and on EHCI it's also configurable. Otherwise drivers will not be able to tell in advance what requests are legal.

- Dave




------------------------------------------------------- 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

Reply via email to