Re: ehci_hcd / uvcvideo bug

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jun 20, 2012 at 11:23 PM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
> On Wed, 20 Jun 2012, Ming Lei wrote:
>
>> Looks there is an obvious bug in uvcvideo, and the below patch may fix it:
>>
>> diff --git a/drivers/media/video/uvc/uvc_video.c
>> b/drivers/media/video/uvc/uvc_video.c
>> index b76b0ac..d1e7cb2 100644
>> --- a/drivers/media/video/uvc/uvc_video.c
>> +++ b/drivers/media/video/uvc/uvc_video.c
>> @@ -1594,7 +1594,7 @@ static int uvc_init_video(struct uvc_streaming
>> *stream, gfp_t gfp_flags)
>>                       psize = le16_to_cpu(ep->desc.wMaxPacketSize);
>>                       psize = (psize & 0x07ff) * (1 + ((psize >> 11) & 3));
>>                       if (psize >= bandwidth && psize <= best_psize) {
>> -                             altsetting = i;
>> +                             altsetting = alts->desc.bAlternateSetting;
>>                               best_psize = psize;
>>                               best_ep = ep;
>>                       }
>
> Yes, that definitely looks like a bug.  It could be responsible for the
> wrong packet lengths, although I can't tell from the information in the
> bug report.
>
>> But the bug may not relate with the above.

After further thinking, the patch above may keep MPS consistent with altsetting,
so a correct altsetting should be set into device.

Anyone who has the device may try it.

>>
>> Probably it is caused by mistaken intf->num_altsetting of 12, instead of
>> 13.
>
> How do you know intf->num_altsetting was set to 12?

Just a guess and reasoning, :-)

Because 3060 in iso_frame_desc is corresponding to the last altsetting,
which is set as 11 into the uvc video interface, so I guess intf->num_altsetting
might be set as 12 mistakenly and the problem is triggered.

>
>> Also from the usbmon trace, all packets are completed with length of 12,
>> which indicates that there aren't capture data at all.
>
> Maybe there wasn't supposed to be any.  Anyway, that's a separate
> problem.

It might be a result of mismatch between packet size and altsetting set
into device.

>
>> > Now the question is: Why were interrupts not delivered for such a long
>> > period?  I'm not at all sure how to find out.
>>
>> Maybe the irqsoff tracer can help troubleshoot it.
>
> What is the irqsoff tracer?

Please see the section of "The Tracers" in Documentation/trace/ftrace.txt.

Also considered that io_watchdog is disabled in intel ehci controller, is it
possible there are no interrupts coming from ehci hardware?

Thanks,
--
Ming Lei
--
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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux