On Sun, Dec 29, 2013 at 02:54:40AM -0200, Mauro Carvalho Chehab wrote: > 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. I think that's due to the driver (or userspace) attempting to reset the endpoint when it didn't actually receive a stall (-EPIPE) status from an URB. When that happens, the xHCI host controller endpoint "toggle" bits get out of sync with the device toggle bits, and the result is that all transfers will fail to the endpoint from then on until you switch alternate interface settings or unplug/replug the device. Try this patch: http://marc.info/?l=linux-usb&m=138116117104619&w=2 It's still under RFC, and I know it has race conditions, but it will let you quickly test whether this fixes your issue. This has been a long-standing xHCI driver bug. I asked my OPW intern to work on the patch to fix it, but she may be a bit busy with her new job to finish up the RFC. I'll probably have to take over finishing the patch, if this turns out to be your issue. > (Not sure why it is trying to stop all endpoints - as just one endpoint was > requested to restart). Something is calling into usb_clear_halt() with all the endpoints. Userspace, perhaps? You could add WARN() calls to usb_clear_halt() to see what code is resetting the endpoints. In any case, it's not part of the USB core code to change configuration or alt settings, since I don't see any xHCI driver output from the endpoint bandwidth code in this chunk of the dmesg you sent: [ 1649.640783] xhci_hcd 0000:00:14.0: Removing canceled TD starting at 0xb41e8580 (dma). [ 1649.640784] xhci_hcd 0000:00:14.0: TRB to noop at offset 0xb41e8580 [ 1649.643159] xhci_hcd 0000:00:14.0: Endpoint 0x81 not halted, refusing to reset. [ 1649.643188] xhci_hcd 0000:00:14.0: Endpoint 0x82 not halted, refusing to reset. [ 1649.643215] xhci_hcd 0000:00:14.0: Endpoint 0x83 not halted, refusing to reset. [ 1649.643239] xhci_hcd 0000:00:14.0: Endpoint 0x84 not halted, refusing to reset. [ 1649.735539] xhci_hcd 0000:00:14.0: ERROR no room on ep ring, try ring expansion Sarah Sharp -- 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