Re: Isochronous URB submission failure upon resume

Alan Stern <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Sat, 1 Sep 2007, Laurent Pinchart wrote:

> Hi everybody,
> 
> I'm having an intermittent failure when submitting URB after resume from 
> suspend-to-RAM (kernel 2.6.22).
> 
> The driver (uvcvideo, a webcam driver available at 
> http://linux-uvc.berlios.de) implements suspend/resume support. If a video 
> transfer is active at suspend time, it cancels active URBs and resubmits them 
> when resuming.
> 
> Resubmitting URBs at resume time works. However, usb_submit_urb() then 
> sometimes fail pretty soon when called in the URB completion handler. Here's 
> a kernel log excerpt from resume time:
> 
> uvcvideo: Resuming interface 0
> uvcvideo: Resuming interface 1

This is unclear.  The part of the log just above this is critical, but
you don't show it.  To what device is uvcvideo bound?

Do these uvcvideo lines occur in the log before or after the 4-1 and
4-2 stuff below?  Here they seem to come _before_.

>  usbdev4.4_ep00: PM: resume from 0, parent 4-1 still 2
> hci_usb 4-1:1.0: PM: resume from 2, parent 4-1 still 2
> hci0: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.4_ep81: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.4_ep02: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.4_ep82: PM: resume from 0, parent 4-1:1.0 still 2
> usb 4-1:1.1: PM: resume from 2, parent 4-1 still 2
>  usbdev4.4_ep03: PM: resume from 0, parent 4-1:1.1 still 2
>  usbdev4.4_ep83: PM: resume from 0, parent 4-1:1.1 still 2
> usb 4-1:1.2: PM: resume from 2, parent 4-1 still 2
>  usbdev4.4: PM: resume from 0, parent 4-1 still 2
>  usbdev4.5_ep00: PM: resume from 0, parent 4-2 still 2
>  usbdev4.5_ep81: PM: resume from 0, parent 4-2:1.0 still 2
>  usbdev4.5_ep82: PM: resume from 0, parent 4-2:1.0 still 2
>  usbdev4.5: PM: resume from 0, parent 4-2 still 2

How much of this is relevant?  4-1 appears to be a USB-Bluetooth 
device, since it has an interface bound to hci_usb.  Presumably that 
means it has nothing in common with uvcvideo.  What is 4-2?

> Restarting tasks ... <6>usb 4-1: USB disconnect, address 4
> uvcvideo: Failed to resubmit video URB (-45).
> uvcvideo: Failed to resubmit video URB (-45).
> uvcvideo: Failed to resubmit video URB (-45).
> uvcvideo: Failed to resubmit video URB (-45).
> done.

-45 is -EL2NSYNC, which is used only by ehci-hcd.  It indicates that 
the URB was submitted after the first time slot had already expired.

> The driver submits isoc URBs when printing the second message ('Resuming 
> interface 1'). When tasks are restarted, it fails to resubmit them in the URB 
> completion handler.
> 
> When the URB submission doesn't fail, the kernel log contains the following 
> messages:
> 
>  usbdev4.2_ep00: PM: resume from 0, parent 4-1 still 2
> hci_usb 4-1:1.0: PM: resume from 2, parent 4-1 still 2
>  usbdev4.2_ep81: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.2_ep02: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.2_ep82: PM: resume from 0, parent 4-1:1.0 still 2
>  usbdev4.2_ep03: PM: resume from 0, parent 4-1:1.1 still 2
>  usbdev4.2_ep83: PM: resume from 0, parent 4-1:1.1 still 2
>  usbdev4.2: PM: resume from 0, parent 4-1 still 2
>  usbdev4.3_ep00: PM: resume from 0, parent 4-2 still 2
>  usbdev4.3_ep81: PM: resume from 0, parent 4-2:1.0 still 2
>  usbdev4.3_ep82: PM: resume from 0, parent 4-2:1.0 still 2
>  usbdev4.3: PM: resume from 0, parent 4-2 still 2
> ADDRCONF(NETDEV_CHANGE): eth1: link becomes ready
> hci0: PM: resume from 0, parent 4-1:1.0 still 2
> uvcvideo: Resuming interface 0
> uvcvideo: Resuming interface 1
> uvcvideo: interface 1 altsetting 3
> Restarting tasks ... <6>usb 4-1: USB disconnect, address 2
> done.

Here the uvcvideo lines come _after_ the 4-1 and 4-2 lines.

> I'm not familiar with the usbcore suspend/resume implementation. Could someone 
> help me to diagnose the problem ?

You should always use CONFIG_USB_DEBUG when posting problems like this 
on the mailing list.  It also wouldn't hurt to show the relevant 
portions of /proc/bus/usb/devices, and include more of the log context.

Alan Stern


-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.