TX1 Tegra XUDC controller error

In my ongoing effort to get bulk mode working for the USB webcam gadget, I’ve stumbled across another clue I’m trying to track down. This appears in the logs, coming from drivers/usb/gadget/udc/tegra_xudc.c line 3030. TRB type 0x25 isn’t defined, but after some searching appears to be TRB_TYPE_HOST_CONTROLLER_EVENT.

Anyone have any idea what the host controller is trying to report back to the kernel? Or a way to debug this further?

[Fri Aug 24 11:26:02 2018] [ 90.266672] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:02 2018] [ 90.623606] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:02 2018] [ 90.890673] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:03 2018] [ 91.154899] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:03 2018] [ 91.420229] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:03 2018] [ 91.684271] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:03 2018] [ 91.948204] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:04 2018] [ 92.212518] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:04 2018] [ 92.477156] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:04 2018] [ 92.741304] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:04 2018] [ 93.004615] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:05 2018] [ 93.268101] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:05 2018] [ 93.531380] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:05 2018] [ 93.795775] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:06 2018] [ 94.059072] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:06 2018] [ 94.323608] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:06 2018] [ 94.587867] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:06 2018] [ 94.854172] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:07 2018] [ 95.118144] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:07 2018] [ 95.382324] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:07 2018] [ 95.646345] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:07 2018] [ 95.910575] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:08 2018] [ 96.173761] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:08 2018] [ 96.440522] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:08 2018] [ 96.704072] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:08 2018] [ 96.967636] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:09 2018] [ 97.232693] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:09 2018] [ 97.496455] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:09 2018] [ 97.759320] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:09 2018] [ 98.022459] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:10 2018] [ 98.287368] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:10 2018] [ 98.550128] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:10 2018] [ 98.813020] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:11 2018] [ 99.078185] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:11 2018] [ 99.340909] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:11 2018] [ 99.604421] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:11 2018] [ 99.867339] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25
[Fri Aug 24 11:26:12 2018] [ 100.130476] tegra-xudc-new 700d0000.xudc: Unrecognized TRB type = 0x25

Are you trying to make the OTG port in device mode appear to be an isochronous mode camera? If so, then this port does not support isochronous. I suspect this is what the TRB type is for, but I have not attempted to verify. If this is the case, then you’ll have to switch to something like bulk mode instead of isochronous.

Not isochronous, no. The kernel is carrying a set of changes to the UVC gadget driver to make it request bulk endpoints instead of ISOCH. The above is what happens with the changes for bulk mode.

In that case I don’t know what is going on. I’m not sure what the TRB 0x25 represents.

37 (0x25) appears to be a host controller event. See the matching definition here: https://github.com/tianocore/edk2/blob/master/SourceLevelDebugPkg/Library/DebugCommunicationLibUsb3/DebugCommunicationLibUsb3Internal.h#L179

Also, section 6.4.6 of this document: http://composter.com.ua/documents/xHCI_Specification_for_USB.pdf

Hi,
We don’t have much experience in USB webcam gadget. Wish other users can share experience.

If the issue can be reproduced with Logitech c930 or e-con See3CAM_CU135 usb cams, please share us steps so that we can reproduce the issue and do further check.

Hello DaneLLL,

Is there any documentation that can be shared on the Tegra XUDC controller? I’d like to add a bit of diagnostics to drivers/usb/gadget/udc/tegra_xudc.c for the TRB_TYPE_HOST_CONTROLLER_EVENT case generated by the controller.

Hi,
The controller follows USB standard. Please refer to section 6.4.2.6 in
https://www.google.com.tw/search?q=xhci+specification&oq=xhci+specification&aqs=chrome..69i57j0l5.7750j0j8&sourceid=chrome&ie=UTF-8

It should give information about dump_trb().