Em Mon, 18 Mar 2013 09:51:24 -0700 Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx> escreveu: > On Tue, Mar 12, 2013 at 10:57:22AM +0100, jean-philippe francois wrote: > > 2013/3/12 jean-philippe francois <jp.francois@xxxxxxxxxx>: > > > 2013/3/12 Sarah Sharp <sarah.a.sharp@xxxxxxxxxxxxxxx>: > > >> On Mon, Mar 11, 2013 at 01:21:48PM +0100, jean-philippe francois wrote: > > >>> Hi, > > >>> > > >>> The company I work for is doing USB cameras, for which I wrote the > > >>> drivers (out of tree). > > >> > > >> Kernel driver or userspace driver? > > >> > > > Kernel driver. > > Ok, I don't know what license your driver is under, so I can't legally > look at the C snippet you sent me. Sarah, I'm experiencing a similar error with the in-kernel em28xx driver, plus some fixes that I'm writing for Kernel 3.14. The tree with the driver is at: http://git.linuxtv.org/mchehab/experimental.git/shortlog/refs/heads/em28xx-v4l2 The code with troubles is at: http://git.linuxtv.org/mchehab/experimental.git/blob/refs/heads/em28xx-v4l2:/drivers/media/usb/em28xx/em28xx-audio.c Basically, the device works fine on an USB 2.0 port, but if I connect it on any of the 3 existing USB 3.0 ports on my notebook, the audio endpoint doesn't work. On this device, there are two isoc transfers: one for video (on frame on every 1/60 seconds) and another one for audio. Each on a different endpoint. The video transfers happen fine. The audio transfer doesn't. Due to the way the userspace works, every time the channel changes, the audio stream is stopped and restarted. The code that starts streaming is at line 164: 164 static int em28xx_init_audio_isoc(struct em28xx *dev) 165 { 166 int i, errCode; 167 168 dprintk("Starting isoc transfers\n"); 169 170 /* Start streaming */ 171 for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { 172 memset(dev->adev.transfer_buffer[i], 0x80, 173 dev->adev.urb[i]->transfer_buffer_length); 174 175 errCode = usb_submit_urb(dev->adev.urb[i], GFP_ATOMIC); 176 if (errCode) { 177 em28xx_errdev("submit of audio urb failed\n"); 178 em28xx_deinit_isoc_audio(dev); 179 atomic_set(&dev->stream_started, 0); 180 return errCode; 181 } 182 183 } 184 185 return 0; 186 } And the code that stops it is: 61 static int em28xx_deinit_isoc_audio(struct em28xx *dev) 62 { 63 int i; 64 65 dprintk("Stopping isoc\n"); 66 for (i = 0; i < EM28XX_AUDIO_BUFS; i++) { 67 struct urb *urb = dev->adev.urb[i]; 68 69 if (!irqs_disabled()) 70 usb_kill_urb(urb); 71 else 72 usb_unlink_urb(urb); 73 } 74 75 return 0; 76 } It seems that usb_unlink_urb() is causing troubles with xHCI: the endpoint stops streaming, but, after that, it doesn't start again, and lots of debug messages are produced. I emailed you the full log after start streaming in priv (too big for vger), but basically, it produces: [ 1635.754546] xhci_hcd 0000:00:14.0: Endpoint 0x81 not halted, refusing to reset. [ 1635.754562] xhci_hcd 0000:00:14.0: Endpoint 0x82 not halted, refusing to reset. [ 1635.754577] xhci_hcd 0000:00:14.0: Endpoint 0x83 not halted, refusing to reset. [ 1635.754594] xhci_hcd 0000:00:14.0: Endpoint 0x84 not halted, refusing to reset. (Not sure why it is trying to stop all endpoints - as just one endpoint was requested to restart). FYI, my tests are with xHCI 1.0: [ 3.640583] xhci_hcd 0000:00:14.0: // @ffffc900040c0000 = 0x1000080 (CAPLENGTH AND HCIVERSION) Any ideas? -- Cheers, Mauro -- 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