Re: Control message failures kill entire XHCI stack

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

 



Hi Mathias,

On Thu, Mar 5, 2015 at 4:25 PM, Mathias Nyman
<mathias.nyman@xxxxxxxxxxxxxxx> wrote:
> On 04.03.2015 15:27, Alistair Grant wrote:
>> On Tue, Mar 3, 2015 at 8:40 PM, Alistair Grant <akgrant0710@xxxxxxxxx> wrote:
>>> On Tue, Mar 3, 2015 at 2:21 PM, Mathias Nyman
>>> <mathias.nyman@xxxxxxxxxxxxxxx> wrote:
>>>> On 28.02.2015 09:16, Alistair Grant wrote:
>>>>> ...
>>>>> * 3.19.0 with the following patches:
>>>>> * xhci: Allocate correct amount of scratchpad buffers
>>>>> * xhci: Don't touch TRBs memory if those are no longer on the endpoint ring
>>>>> * xhci: fix invalid pointer in reset device debugging
>>>>> * xhci: add debugging for reset device and stop endpoint commands
>>>>> * xhci: add command ring stop and restart debug messages
>>>>>
>>>>
>>>> Does increasing the TRB count per segment help?
>>>
>>> Success!
>>>
>>> Increasing TRBS_PER_SEGMENT from 64 to 256 allowed me to successfully
>>> record two 30 second segments of video, i.e. start recording with
>>> mythffmpeg, Ctrl-C after 30 seconds, then repeat (this is on top of the
>>> patched kernel I reported in my last message).
>>>
>> ...
>> I assume that this is a workaround, and that the core problem of ring
>> expansion & cancelled URBs is still to be resolved.  Let me know if
>> you would like that tested when it is ready.
>>
>
> Hi
>
> yes, this is a workaround.
>
> The latest theory for the cause is that we fill up the event ring. This
> would be possible because we pick events from the event ring only on interrupt.
>
> Isoc transfers are set to only interrupt at the last TD, with several isoc transfer
> going on simultaneously, and especially with isoc transfer containing so many TDs we need
> to increase the transfer ring (hence the ring expansion befora failure in the log) we fill
> up the event ring and won't receive any stop endpoint event -> timeout -> kill HC
>
> Increasing the TRBS_PER_SEGMENTS helps as it also increases the event ring.
>
> If you have time could you try forcing interrupts on every isoc TRB with the following change:
>
> diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
> index 151484e..dfad305 100644
> --- a/drivers/usb/host/xhci.c
> +++ b/drivers/usb/host/xhci.c
> @@ -539,6 +539,8 @@ int xhci_init(struct usb_hcd *hcd)
>                 xhci_dbg_trace(xhci, trace_xhci_dbg_init,
>                                 "xHCI doesn't need link TRB QUIRK");
>         }
> +       xhci->quirks |= XHCI_AVOID_BEI;
> +
>         retval = xhci_mem_init(xhci, GFP_KERNEL);
>         xhci_dbg_trace(xhci, trace_xhci_dbg_init, "Finished xhci_init
>
> with the old TRBS_PER_SEGMENT size, and see if it helps

This worked without any problems also - I only recorded about 3
minutes of video, but I doubt that the length matters.

FYI, the following messages still appear in syslog:

Mar  5 19:56:19 alistair-XPS13 kernel: [   68.725309] xhci_hcd
0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or
ep state.

Mar  5 19:56:19 alistair-XPS13 kernel: [   68.725411] xhci_hcd
0000:00:14.0: Cancelled TD not on stopped ring (multiple times)

Mar  5 19:56:19 alistair-XPS13 kernel: [   68.725420] xhci_hcd
0000:00:14.0: Cancel URB NOT on current ring (multiple times)

Mar  5 20:00:17 alistair-XPS13 kernel: [  306.192925] xhci_hcd
0000:00:14.0: WARN Set TR Deq Ptr cmd failed due to incorrect slot or
ep state.

>From memory, the warning only appeared once with TRBS_PER_SEGMENT=256.

HTH,
Alistair
--
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