How to disable LPM for USB 3.0 in Apalis TK1

I try to connect specific vendor usb 3.0 camera. I have api with 3 endpoints and one of them get image (ENDPOINT 0x86). After some time of receiving image, libusb return timeout error. There’re different times for receiving error on different cables (1 - 150-200 frames, 2 - 9000 - 12000 frames). I tried command dmesg to show log, when connect the camera. In Tk1 i see:

Parent Hub missing LPM exit latency info. Power management will be impacted.

I also tried to connect camera to x86 PC with Ubuntu 18.0.4 LTS and there are evything is ok, but as i understand from dmesg, it automatically disable LPM:

LPM exit latency is zeroed, disabling LPM.

So, i think i need to disable LPM fot this usb 3.0. device manually. How iiit possible to make on Ubuntu for TK1?

hi @Danila24

Which carrier Board are you using?
Which USB Port are you using?
Could you provide the datasheet of the USB 3.0 Camera?
Please share the dmesg log in a file?

Thanks and best regards, Jaski

hi @jaski.tx
I use Apalis Evaluation Board V1.1A. I use USB 3.0 port (X51, USBH4-SS) on board. I can’t provide you datasheet, because, this is vendor specific camera, basec on CMV4000 sensor. There are 3 endpoints - 0x01 (control commands), 0x81 (getting status), 0,86 (for getting frame).

Device Capability SuperSpeed Descriptor:
    ------------------------------
    0x0A	bLength
    0x10	bDescriptorType
    0x03	bDevCapabilityType
    0x00	bmAttributes
    0x000E	wSpeedsSupported    (supported: FS | HS | SS)
    0x03	bFunctionalitySupport
    0x00	bU1DevExitLat
    0x0000	wU2DevExitLat

dmesg log:

ubuntu@tegra-ubuntu:~$ dmesg
[  837.275217] usb 2-1: new SuperSpeed USB device number 15 using tegra-xhci
[  837.291933] usb 2-1: Parent hub missing LPM exit latency info.  Power management will be impacted.
[  837.301634] usb 2-1: New USB device found, idVendor=dcdc, idProduct=3102
[  837.301649] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[  837.301658] usb 2-1: Product: GEO-CMV Ver. 1.00
[  837.301666] usb 2-1: Manufacturer: STT llc
[  837.301673] usb 2-1: SerialNumber: 1700

Apalis TK1 is configured with LPM disabled and that message " Parent Hub missing LPM exit latency info. Power management will be impacted." indicates it.

hmm… As is see from x86 log: “LPM exit latency is zeroed, disabling LPM.”, it disables LPM. As i understand from yout message, it disabled in hub TK1. Ok. Can you answer me, why camera is working well in x86 machine, an works bad in ARM tk1. Bad working means that from some time libusb return timeout error from endpoint 0x86, that get image from camera. On x86 everything is ok, no timeout.

Maybe i need turn off autosuspending, but how it make right?

Can you try on Ixora instead of the Apalis evaluation board?

I tried to connect to Ixora, and i see same message from dmesg about lpm.

But does it actually work on Ixora?

@marcel.tx I don’t make long test with camera on Ixora. What differences between Evaluation and Ixora USB 3.0 ports? Why it should work on Ixora?

hi @Danila24

First of all as you wrote, you got an error with different cables, you should try a short length good quality cable. If this doesn’t help then you should also consider using an external HUB.

Regarding the differences between Evaluation Board and Ixora, the Evaluation Board is not made and qualified for Production Use, but Ixora is. So you should try this on Ixora Board with the newest Bsp 2.8b5 and check if you see some Issues?

@marcel.tx I made test on Ixora. It doesn’t work. Can’t receive even 1 frame. Usb 2.0 works perfectly. And another question, on Ixora bottom usb 3.0 port works as usb 3.0, but top port doesn’t. I understand it from dmesg command. When connects to top port, it indicates as High-speed device, and uses tegra-ehci, bottom - SuperSpeed device, and uses tegra-xhci.

@jaski.tx I use this cable: http://www.l-com.com/usb-usb-30-type-a-straight-to-micro-b-right-angle-exit-03m#
And also tried different no_name cables, thats works better. I also tried to connect with external hub without/with power and it also give timeout error.

And that is still with the unsupported BSP 2.8b3 or did you already update to our latest BSP 2.8b5?

First SoC (with evaluation board) uses Ubuntu 14.0.4 lts with 2.8b3, second (ixora board) - 2.8b4

Could you update to Bsp 2.8b5 and check if you still see the Issue? If you try Usb 3.0 Ports, which one is not working on the Ixora Board?

I tried on BSP 2.8b5. There’s no differencies. We have two Ixora boards, and different results. First board - top (tegra-ehci), bottom (tegra-xhci). Second - vice versa.

Do these Ixora and Apalis TK1 have the same Hardware Versions?

Sorry, I misled you about two different Ixora cards, because our group don’t use it, i just asked another group to make test. This’s two identically cards, but fact, that two usb 3.0 ports work different. Ok, but what about LPM and Suspend Mode? I also tried to open task on Nvidia forum (https://devtalk.nvidia.com/default/topic/1047173/jetson-tk1/disable-lpm-for-usb-3-0-in-tk1/?offset=9#5315052).

Hi, Thanks for this Information. About your questions, LPM is disabled and Suspend mode is working fine.

Concerning the talk in the Nvidia Forum, you need to add usbcore.autosuspend to the U-Boot variable defargs.

an works bad in ARM tk1. Bad working means that from some time libusb return timeout error from endpoint 0x86, that get image from camera. On x86 everything is ok, no timeout.

How many times do you have this timeout? If you redo the transmission, does the transmission work or do you get again a timeout. You could try to disable hot-plugging and setting the frequency to Maximum as described here and check if you still have the issue.

Best regards,
Jaski