Hi Alan,

On Wed, Jul 10, 2013 at 10:48 AM, Alan Stern <st...@rowland.harvard.edu> wrote:
> Digging into the scheduling code probably won't help much.  However you
> could try collecting a usbmon trace (see Documentation/usb/usbmon.txt).
> This would clearly show the timing of URB submissions and completions.

Good suggestion.  I'll do that.

>> I'll be the first to admit that this isn't my particular area of
>> expertise - so if I've made some stupid assumption about the expected
>> behavior for the URB timing on the bus, don't hesitate to point that
>> out.
>
> The transfers should occur regularly at 1-microframe intervals.  If
> they don't then something is wrong somewhere.  But I think the problem
> is more likely to lie in the upper-level driver than in ehci-hcd.
> You're using the em28xx driver?

Yes.

> At first glance, there is one obvious bug in that driver (probably not
> at all related to your problem, though).  The em28xx_irq_callback()
> routine should not set urb->status.

I noticed that already and have it fixed in my local tree.  It'll be
in my next pull request.  That said, fixing that had no effect.

> I bet the problem is related to the usage of the URB_ISO_ASAP flag.
> em28xx_alloc_urbs() sets URB_ISO_ASAP in urb->transfer_flags, and the
> value never gets cleared.  In fact, that flag bit is supposed to be set
> only in the first URB of a stream, not in the following URBs.  (The
> same mistake is present for the URBs in the audio stream.)

Wow, REALLY?  Ok, if that's the case then I will fix that and see if
it makes any difference.  That really should be documented somewhere
because I've seen it done that way in a bunch of different drivers
(and in fact done it myself that way in several drivers I wrote in the
media tree).

Just so I'm understanding what is supposed to be the expected behavior
- so it should be set in the first URB, but what about when we
resubmit the URBs? Should I be clearing the flag prior to resubmitting
the first URB (since it will be unchanged)?  Or is the expected
behavior that I set it on the first URB, and then nothing is supposed
to ever touch transfer flags on any URB from that point forward?

While on that topic, I'm clearing the status and actual_length fields
in all of the iso_frame_desc[] fields of the URB prior to resubmitting
- should I be doing that?  Are there other fields I should be
resetting?

Thank you so much for your help!

Devin

-- 
Devin J. Heitmueller - Kernel Labs
http://www.kernellabs.com
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to