Re: xhci bandwidth problem with isochronous endpoints

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

 



On 09/19/2017 06:00 AM, Mathias Nyman wrote:
On 08.09.2017 20:35, Curt Meyers wrote:
On 09/05/2017 02:56 PM, Curt Meyers wrote:
On 09/04/2017 04:13 AM, Mathias Nyman wrote:
On 04.09.2017 13:46, Felipe Balbi wrote:

Hi,

Mathias Nyman <mathias.nyman@xxxxxxxxxxxxxxx> writes:
Unfortunately config endpoint command doesn't log endpoint context in this log, it should call  trace_xhci_handle_cmd_config_ep(ep_ctx), I don't know why it's missing.

That's called conditionally:

    case TRB_CONFIG_EP:
        if (!cmd->completion)
            xhci_handle_cmd_config_ep(xhci, slot_id, event,
                          cmd_comp_code);

Yep, need to change the tracing so we get it for every config endpoint command


But later on at Set TR Dequeue Pointer Command it logs the endpiont context:

259.147237: xhci_handle_cmd_set_deq: RS 00000 super-speed Ctx Entries 7 MEL 512 us Port# 19/0 [TT Slot 0 Port# 0 TTT 0 Intr 0] Addr 1 State configured 259.147238: xhci_handle_cmd_set_deq_ep: State stopped mult 1 max P. Streams 0 interval 125 us max ESIT payload 201326592 CErr 0 Type Isoc IN burst 2 maxp 1024 deq 00000003f9fd6510 avg trb len 3072

This looks odd,  201326592 bytes per ESIT, way too much. So much that I suspect tracing decodes it wrong

try this:

modified   drivers/usb/host/xhci.h
@@ -2540,9 +2540,7 @@ static inline const char *xhci_decode_ep_context(u32 info, u32 info2, u64 deq,
      u8 lsa;
      u8 hid;

-    esit = EP_MAX_ESIT_PAYLOAD_HI(info) << 16 |
-        EP_MAX_ESIT_PAYLOAD_LO(tx_info);
-
+    esit = CTX_TO_MAX_ESIT_PAYLOAD(info);
      ep_state = info & EP_STATE_MASK;
      max_pstr = info & EP_MAXPSTREAMS_MASK;
      interval = CTX_TO_EP_INTERVAL(info);


Yes, I noticed the same, and there's also a high ESIT bit field for new hosts,
I pushed a fix to my for-usb-linus branch for that

+#define CTX_TO_MAX_ESIT_PAYLOAD_HI(p)  (((p) >> 24) & 0xff)

...

-       esit = EP_MAX_ESIT_PAYLOAD_HI(info) << 16 |
-               EP_MAX_ESIT_PAYLOAD_LO(tx_info);
+       esit = CTX_TO_MAX_ESIT_PAYLOAD_HI(info) << 16 |
+               CTX_TO_MAX_ESIT_PAYLOAD(tx_info);

-Mathias
Hi Mathias,



Hi Sorry about the delay


I have made the above suggested changed and produced a new trace file. I hope this helps out.

Curt

Would it help if I sent you a couple of these USB camera devices to speed up debugging?


Not really, It's just my TODO list is already quite long, and then there's always some urgent matter
that requires attention.

The new log however still shows the wrong ESIT payload values,
 xhci_handle_cmd_set_deq_ep: State stopped mult 1 max P. Streams 0 interval 125 us max ESIT payload 201326592

-Mathias

--
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

Hi Mathias,

The manufacture hired a Linux developer to solve the problem with this isochronous camera device and it turns out to be related to LPM that only shows up in newer Intel hardware, according to the developer. He says that there is something wrong with the MEL (Max Exit Latency) and skipping it in the call to xhci_configure_endpoint() fixes the problem, or works around it.

Curt


--
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