3

I'm experiencing weird behavior on a custom board that is flashed through USB hub and I'm trying to determine the root cause.

When flashing is attempted from natively (Linux XPS-15-9560 4.19.0-041900-generic #201810221809 SMP Mon Oct 22 22:11:45 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux), it fails with:

 open("/dev/bus/usb/001/039", O_RDWR)    = 5
 read(5, "\22\1\0\2\0\0\0@U\t\30x\0\0\1\2\0\1\t\2 \0\1\1\0\300\20\t\4\0\0\2\377\377\377\0\7\5\201\2@\0\0\7\5\1\2@\0\0", 1024) = 50
 close(4)                                = 0
 close(3)                                = 0
 ioctl(5, USBDEVFS_CLAIMINTERFACE, 0x9f346b0) = 0
 ioctl(5, USBDEVFS_BULK, 0xffbc1d30)     = -1 ETIMEDOUT (Connection timed out)

And the corresponding usbmon:

 ffff90732cdbbcc0 2090024900 S Ci:1:014:0 s a3 00 0000 0001 0004 4 <
 ffff90732cdbbcc0 2090024932 C Ci:1:014:0 0 4 = 03050000
 ffff90732cdbb6c0 2116444706 S Bi:1:015:1 -115 96 <
 ffff90732cdbb6c0 2116444759 C Bi:1:015:1 0 16 = 40800101 00000024 02575064 01108081
 ffff90732cdbb900 2116716579 S Bo:1:015:1 -115 1472 = c0050000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
 ffff90732cdbb900 2121948281 C Bo:1:015:1 -2 

The structure is:

 /:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/8p, 5000M
    |__ Port 1: Dev 5, If 0, Class=Hub, Driver=hub/2p, 5000M                                      # USB 3 part of 8020
 /:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/16p, 480M
    |__ Port 1: Dev 14, If 0, Class=Hub, Driver=hub/2p, 480M                                      # USB 2 part of 8020
        |__ Port 1: Dev 15, If 0, Class=Vendor Specific Class, Driver=, 480M                      # target board
        |__ Port 2: Dev 16, If 3, Class=Vendor Specific Class, Driver=ftdi_sio, 480M              # FTDI
        |__ Port 2: Dev 16, If 1, Class=Vendor Specific Class, Driver=ftdi_sio, 480M              # FTDI
        |__ Port 2: Dev 16, If 2, Class=Vendor Specific Class, Driver=ftdi_sio, 480M              # FTDI
        |__ Port 2: Dev 16, If 0, Class=Vendor Specific Class, Driver=ftdi_sio, 480M              # FTDI

Dmesg reports:

 [ 7718.687335] usb 1-1.1: New USB device strings: Mfr=0, Product=0, SerialNumber=1
 [ 7718.687339] usb 1-1.1: SerialNumber: 800508593070
 [ 7718.688754] hub 1-1.1:1.0: USB hub found
 [ 7718.688798] hub 1-1.1:1.0: 2 ports detected
 [ 7718.975225] usb 1-1.1.1: new high-speed USB device number 17 using xhci_hcd
 [ 7719.075855] usb 1-1.1.1: config 1 interface 0 altsetting 0 bulk endpoint 0x81 has invalid maxpacket 64
 [ 7719.075862] usb 1-1.1.1: config 1 interface 0 altsetting 0 bulk endpoint 0x1 has invalid maxpacket 64
 [ 7719.076290] usb 1-1.1.1: New USB device found, idVendor=0955, idProduct=7818, bcdDevice= 0.00
 [ 7719.076296] usb 1-1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 [ 7719.076300] usb 1-1.1.1: Product: APX
 [ 7719.076304] usb 1-1.1.1: Manufacturer: NVIDIA Corp.
 [ 7719.159230] usb 1-1.1.2: new high-speed USB device number 18 using xhci_hcd
 [ 7719.259916] usb 1-1.1.2: New USB device found, idVendor=0403, idProduct=6011, bcdDevice= 8.00
 [ 7719.259923] usb 1-1.1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
 [ 7719.259927] usb 1-1.1.2: Product: Quad RS232-HS
 [ 7719.259931] usb 1-1.1.2: Manufacturer: FTDI
 [ 7719.266889] ftdi_sio 1-1.1.2:1.0: FTDI USB Serial Device converter detected
 [ 7719.267021] usb 1-1.1.2: Detected FT4232H
 [ 7719.267229] usb 1-1.1.2: FTDI USB Serial Device converter now attached to ttyUSB0
 [ 7719.267580] ftdi_sio 1-1.1.2:1.1: FTDI USB Serial Device converter detected
 [ 7719.267653] usb 1-1.1.2: Detected FT4232H
 [ 7719.267944] usb 1-1.1.2: FTDI USB Serial Device converter now attached to ttyUSB1
 [ 7719.268278] ftdi_sio 1-1.1.2:1.2: FTDI USB Serial Device converter detected
 [ 7719.268355] usb 1-1.1.2: Detected FT4232H
 [ 7719.268681] usb 1-1.1.2: FTDI USB Serial Device converter now attached to ttyUSB2
 [ 7719.269021] ftdi_sio 1-1.1.2:1.3: FTDI USB Serial Device converter detected 
 [ 7719.269100] usb 1-1.1.2: Detected FT4232H
 [ 7719.269333] usb 1-1.1.2: FTDI USB Serial Device converter now attached to ttyUSB3

pointing to wrong HW configuration.

However, when running the same on VirtualBox ubuntu 16.04 on Win7, the same operation finishes successfully. (on all usb drivers: ohci, ehci, xhci)

Dmesg still complains about the same maxpacket setting beint wrong with different value depending on the current driver (i.e. ehci, ohci, xhci).

I'm confused about the probable root cause since the same config working in, VM IMHO rules out any HW configuration or driver issue.

Do I need to report this to the USB driver maintainer?

Any tips for further debugging?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.