This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BBB: USB Host Controller hub issue

Other Parts Discussed in Thread: AM3352, AM3874, AM3359

During AM3352- based product development we have faced an issue with USB-to-serial converter via usb-hub usage.
At first the device and its driver was blamed  but further investigation showed that this is
a common issue and likewise errors could be reproduced with BeagleBoneBlack, much more popular
USB to Serial converter (PL2303) and its mainline driver.

  As the same configuration of hw is ok with laptop (Core I7) and Freescale IMX6 board with the same kernel/driver the issue points to
  some errors/implementation limitations of the USB HC or its driver.

The issue takes place only when 2 converters are connected to 1 usb hub. If 2 different USB ports are used / in our custom design/ - everything looks ok.

Below I describe the details how to reproduce the issue with BeagleBoneBlack, usb-hub, 2 PL2303 USB-serial converters and the latest SDK by TI. We are using another USB-serial device, but I face likewise issues. As PL2303 is very popular I think it is easier to find.


    Details:

    HW:     BeagleBoneBlack, 2 USB to serial with PL2303 chip, usb-hub.
    SW:     latest prebuilt images from PROCESSOR-SDK-LINUX-AM335X v01.00.00.03   

    Booting the linux, after that attach usb-hub to usb-port, after that plug 2 converters to 1 usb hub.
    (the issue takes place only when two devices are  attached to 1 hub)

    connect devices together (see pic)

    try to setup the speed and mode

    stty -F /dev/ttyUSB0 sane
    stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal

    stty -F /dev/ttyUSB1 sane
    stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    
    with beagle bone I get error like

[  160.102015] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0008]: -110
[  160.201976] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0009]: -110
[  160.301968] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
[  160.401949] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
[  160.501953] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0000]: -110

    According to Linux USB subsystem this is -ETIMEDOUT error from Documentation/usb/error-codes

            Synchronous USB message functions use this code
            to indicate timeout expired before the transfer
            completed, and no other error was reported by HC.

    With another USB-to-serial I sometimes get -32 error, ie
             -EPIPE (**)        Endpoint stalled.

    Could you please try to reproduce the issue.

    If you need any help with setup I am happy to assist.
    The same experiment is ok with freescale IMX, also with 3.14 kernel, so the pl2303 driver is the same.

    The hw and commands are the same.

    As for usb hub I tried 2 models: with external power supply and without;both have the same behavior.


    In our design we strongly rely on the usb devices so we pay high attention to the robustness of the USB HC.

freescale imx6 board:

root7:~# uname -a
Linux imx6 3.14.28vvv #4 SMP PREEMPT Thu Aug 20 17:31:02 MSK
2015 armv7l GNU/Linux
root7:~# lsusb
Bus 001 Device 006: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial
Port
Bus 001 Device 005: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial
Port
Bus 001 Device 004: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Bus 001 Device 003: ID 0424:2517 Standard Microsystems Corp. Hub
Bus 001 Device 002: ID 0424:2512 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root7:~# stty -F /dev/ttyUSB0 sane
root7:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts
clocal
root7:~# stty -F /dev/ttyUSB1 sane
root7:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts
clocal
root7:~# md5sum /bin/bash
7d6ae044a23ec33985f6f951543ba384  /bin/bash
root7:~# cat /dev/ttyUSB0 > fileFromPL1 &
[1] 398
root7:~# cat /bin/bash > /dev/ttyUSB1
root7:~# 
root7:~# ls -l fileFromPL1
-rw-r--r-- 1 root root 863452 Aug 20  2015 fileFromPL1
root7:~# ls -l /bin/bash
-rwxr-xr-x 1 root root 863452 Jul 31 09:43 /bin/bash
root7:~# md5sum fileFromPL1
7d6ae044a23ec33985f6f951543ba384  fileFromPL1

and for BeagleBoneBlack:

root@am335x-evm:~# uname -a
Linux am335x-evm 3.14.43-g875c69b #1 Mon Jul 6 16:00:11 EDT 2015 armv7l GNU/Linux

insert usb-hub with 1 PL
[  120.142012] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[  120.284030] usb 1-1: New USB device found, idVendor=05e3, idProduct=0605
[  120.290798] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
[  120.298040] usb 1-1: Product: USB2.0 Hub
[  120.313279] hub 1-1:1.0: USB hub found
[  120.322528] hub 1-1:1.0: 4 ports detected
[  120.612274] usb 1-1.3: new full-speed USB device number 3 using musb-hdrc
[  120.713249] usb 1-1.3: device v067b p2303 is not supported
[  120.718799] usb 1-1.3: New USB device found, idVendor=067b, idProduct=2303
[  120.725789] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  120.733191] usb 1-1.3: Product: USB-Serial Controller D
[  120.738459] usb 1-1.3: Manufacturer: Prolific Technology Inc. 
[  120.804930] usbcore: registered new interface driver usbserial
[  120.819650] usbcore: registered new interface driver pl2303
[  120.829964] usbserial: USB Serial support registered for pl2303
[  120.838282] pl2303 1-1.3:1.0: pl2303 converter detected
[  120.847580] usb 1-1.3: pl2303 converter now attached to ttyUSB0

insert the second one 

root@am335x-evm:~# [  157.122266] usb 1-1.2: new full-speed USB device number 4 using musb-hdrc
[  157.223139] usb 1-1.2: device v067b p2303 is not supported
[  157.228698] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
[  157.235687] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  157.243093] usb 1-1.2: Product: USB-Serial Controller
[  157.248187] usb 1-1.2: Manufacturer: Prolific Technology Inc.
[  157.263609] pl2303 1-1.2:1.0: pl2303 converter detected
[  157.278606] usb 1-1.2: pl2303 converter now attached to ttyUSB1

root@am335x-evm:~# lsusb
Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port


root@am335x-evm:~# stty -F /dev/ttyUSB0 sane
root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
root@am335x-evm:~# stty -F /dev/ttyUSB1 sane
root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
[  160.102015] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0008]: -110
[  160.201976] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0009]: -110
[  160.301968] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
[  160.401949] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
[  160.501953] pl2303 1-1.2:1.0: pl2303_vendor_write - failed to write [0000]: -110




  • Alyautdin,

    I am in the middle of debugging an issue, and unable to switch my setup to replicate your issue right now. Have you tried MUSB PIO mode to see if the issue is CPPI DMA related?

  • Hi,

    For BeagleBoneBlack I used prebuilt images from  PROCESSOR-SDK-LINUX-AM335X v01.00.00.03,

    According to SDK source code config it is

    CONFIG_USB_MUSB_HDRC=m

    # CONFIG_USB_MUSB_HOST is not set

    # CONFIG_USB_MUSB_GADGET is not set

    CONFIG_USB_MUSB_DUAL_ROLE=y

    # CONFIG_USB_MUSB_TUSB6010 is not set

    CONFIG_USB_MUSB_OMAP2PLUS=m

    # CONFIG_USB_MUSB_AM35X is not set

    CONFIG_USB_MUSB_DSPS=m

    # CONFIG_USB_MUSB_UX500 is not set

    CONFIG_USB_MUSB_AM335X_CHILD=m

    # CONFIG_MUSB_PIO_ONLY is not set

    and

    CONFIG_USB_TI_CPPI41_DMA=y

    CONFIG_TI_CPPI41=y


    In our product we also use DMA for USB. So I haven't tried with PIO.
    Please try the default images from SDK and BBB,
    have you managed to successfully send file from one PL2303 to another with the connection on the picture? The same experiment as in IMX log?

    Regards,
    Roman

  • I have compiled the SDK release kernel (commit 875c69b2c37ba94f9e38d2) with
    CONFIG_MUSB_PIO_ONLY=y
    and observe the same behaviour.

    Regards,
    Roman
  • Roman,

    Thanks for the testing, the issue is not related to MUSB CPPI DMA.

    It seems you have the same issue as in the thread https://e2e.ti.com/support/arm/sitara_arm/f/791/t/441882, which is under investigation. We will keep you posted.

  • Thanks! The issue looks very similar!
    I'm looking forward for updates

    Regards,
    Roman
  • Roman,

    I am unable to reproduce the issue on BBB, tried with two different hubs. Here is my procedure, I did 10+ times. Please let me know if you have done the test differently.

    - Create a sdcard from Processor SDK v1.0.0.3 prebuilt binaries.
    - Boot BBB with the sdcard.
    - Plug in the USB hub to BBB USB1 host port, then both pl2303 cables.
    - The hub and pl2303 are enumerated properly.
    - # stty -F /dev/ttyUSB0 sane
    - # stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
    - # stty -F /dev/ttyUSB1 sane
    - # stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    - # echo test > /dev/ttyUSB0
    - # echo test > /dev/ttyUSB1
    - # echo test > /dev/ttyUSB0

    Everything seems to be normal.
  • Hi Bin,

    I am still facing the issue,

    I have taken the second BBB (one is with AM3359AZCZ100, another is with AM3358BZCZ100)

    and used another hub

    The only difference that we  could  have is the usb-hub chip.

    Looks like nearly all of them are

    Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

    I have found also

    Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub

    but the result is the same.

    What chip are you using?

    I also attach full log of the issue reproducing from booting

  • ti.log
    U-Boot SPL 2014.07-gfb6ab76 (Jul 06 2015 - 16:00:22)
    reading args
    spl_load_image_fat_os: error reading image args, err - -1
    reading u-boot.img
    reading u-boot.img
    
    
    U-Boot 2014.07-gfb6ab76 (Jul 06 2015 - 16:00:22)
    
    I2C:   ready
    DRAM:  512 MiB
    NAND:  0 MiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    reading uboot.env
    
    ** Unable to read "uboot.env" from mmc0:1 **
    Using default environment
    
    Net:   <ethaddr> not set. Validating first E-fuse MAC
    cpsw, usb_ether
    Hit any key to stop autoboot:  0 
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    reading uEnv.txt
    ** Unable to read file uEnv.txt **
    4337552 bytes read in 278 ms (14.9 MiB/s)
    32286 bytes read in 49 ms (642.6 KiB/s)
    Kernel image @ 0x82000000 [ 0x000000 - 0x422f90 ]
    ## Flattened Device Tree blob at 88000000
       Booting using the fdt blob at 0x88000000
       Loading Device Tree to 8fff5000, end 8ffffe1d ... OK
    
    Starting kernel ...
    
    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 3.14.43-g875c69b (gtbldadm@ubuntu-12) (gcc version 4.7.3 20130226 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2013.03-20130313 - Linaro GCC 2013.03) ) #1 Mon Jul 6 16:00:11 EDT 2015
    [    0.000000] CPU: ARMv7 Processor [413fc082] revision 2 (ARMv7), cr=10c5387d
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
    [    0.000000] Machine model: TI AM335x BeagleBone
    [    0.000000] cma: CMA: reserved 24 MiB at 9e000000
    [    0.000000] Memory policy: Data cache writeback
    [    0.000000] CPU: All CPU(s) started in SVC mode.
    [    0.000000] AM335X ES2.1 (sgx neon )
    [    0.000000] Built 1 zonelists in Zone order, mobility grouping on.  Total pages: 129792
    [    0.000000] Kernel command line: console=ttyO0,115200n8 root=/dev/mmcblk0p2 ro rootfstype=ext4 rootwait
    [    0.000000] PID hash table entries: 2048 (order: 1, 8192 bytes)
    [    0.000000] Dentry cache hash table entries: 65536 (order: 6, 262144 bytes)
    [    0.000000] Inode-cache hash table entries: 32768 (order: 5, 131072 bytes)
    [    0.000000] Memory: 485192K/523264K available (5843K kernel code, 303K rwdata, 2144K rodata, 260K init, 232K bss, 38072K reserved, 0K highmem)
    [    0.000000] Virtual kernel memory layout:
    [    0.000000]     vector  : 0xffff0000 - 0xffff1000   (   4 kB)
    [    0.000000]     fixmap  : 0xfff00000 - 0xfffe0000   ( 896 kB)
    [    0.000000]     vmalloc : 0xe0800000 - 0xff000000   ( 488 MB)
    [    0.000000]     lowmem  : 0xc0000000 - 0xe0000000   ( 512 MB)
    [    0.000000]     pkmap   : 0xbfe00000 - 0xc0000000   (   2 MB)
    [    0.000000]     modules : 0xbf000000 - 0xbfe00000   (  14 MB)
    [    0.000000]       .text : 0xc0008000 - 0xc07d50c4   (7989 kB)
    [    0.000000]       .init : 0xc07d6000 - 0xc0817144   ( 261 kB)
    [    0.000000]       .data : 0xc0818000 - 0xc0863da0   ( 304 kB)
    [    0.000000]        .bss : 0xc0863da0 - 0xc089ddb8   ( 233 kB)
    [    0.000000] NR_IRQS:16 nr_irqs:16 16
    [    0.000000] IRQ: Found an INTC at 0xfa200000 (revision 5.0) with 128 interrupts
    [    0.000000] Total of 128 interrupts on 1 active controller
    [    0.000000] OMAP clockevent source: timer2 at 24000000 Hz
    [    0.000012] sched_clock: 32 bits at 24MHz, resolution 41ns, wraps every 178956969942ns
    [    0.000030] OMAP clocksource: timer1 at 24000000 Hz
    [    0.000251] Console: colour dummy device 80x30
    [    0.000271] WARNING: Your 'console=ttyO0' has been replaced by 'ttyS0'
    [    0.000276] This ensures that you still see kernel messages. Please
    [    0.000280] update your kernel commandline.
    [    0.000299] Calibrating delay loop... 996.14 BogoMIPS (lpj=4980736)
    [    0.089554] pid_max: default: 32768 minimum: 301
    [    0.089640] Security Framework initialized
    [    0.089688] Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.089696] Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
    [    0.095231] CPU: Testing write buffer coherency: ok
    [    0.095564] Setting up static identity map for 0x805baa20 - 0x805baa78
    [    0.096347] devtmpfs: initialized
    [    0.097869] VFP support v0.3: implementor 41 architecture 3 part 30 variant c rev 3
    [    0.103458] omap_hwmod: tptc0 using broken dt data from edma
    [    0.103524] omap_hwmod: tptc1 using broken dt data from edma
    [    0.103581] omap_hwmod: tptc2 using broken dt data from edma
    [    0.107490] omap_hwmod: debugss: _wait_target_disable failed
    [    0.162012] pinctrl core: initialized pinctrl subsystem
    [    0.162868] regulator-dummy: no parameters
    [    0.164873] NET: Registered protocol family 16
    [    0.166523] DMA: preallocated 256 KiB pool for atomic coherent allocations
    [    0.168585] cpuidle: using governor ladder
    [    0.168598] cpuidle: using governor menu
    [    0.173732] syscon 44e10000.control_module: regmap [mem 0x44e10000-0x44e107fb] registered
    [    0.174936] platform 49000000.edma: alias fck already exists
    [    0.174954] platform 49000000.edma: alias fck already exists
    [    0.174965] platform 49000000.edma: alias fck already exists
    [    0.175894] OMAP GPIO hardware version 0.1
    [    0.186726] No ATAGs?
    [    0.186744] hw-breakpoint: debug architecture 0x4 unsupported.
    [    0.207979] bio: create slab <bio-0> at 0
    [    0.221005] edma-dma-engine edma-dma-engine.0: TI EDMA DMA engine driver
    [    0.221823] vmmcsd_fixed: 3300 mV 
    [    0.224225] vgaarb: loaded
    [    0.224645] i2c-core: driver [palmas] using legacy suspend method
    [    0.224654] i2c-core: driver [palmas] using legacy resume method
    [    0.225233] SCSI subsystem initialized
    [    0.226442] usbcore: registered new interface driver usbfs
    [    0.226591] usbcore: registered new interface driver hub
    [    0.226751] usbcore: registered new device driver usb
    [    0.227533] omap_i2c 44e0b000.i2c: could not find pctldev for node /pinmux@44e10800/pinmux_i2c0_pins, deferring probe
    [    0.227556] platform 44e0b000.i2c: Driver omap_i2c requests probe deferral
    [    0.227859] pps_core: LinuxPPS API ver. 1 registered
    [    0.227866] pps_core: Software ver. 5.3.6 - Copyright 2005-2007 Rodolfo Giometti <giometti@linux.it>
    [    0.227969] PTP clock support registered
    [    0.229627] omap-mailbox 480c8000.mailbox: omap mailbox rev 0x400
    [    0.230368] Advanced Linux Sound Architecture Driver Initialized.
    [    0.231718] Switched to clocksource timer1
    [    0.247482] NET: Registered protocol family 2
    [    0.248196] TCP established hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.248239] TCP bind hash table entries: 4096 (order: 2, 16384 bytes)
    [    0.248275] TCP: Hash tables configured (established 4096 bind 4096)
    [    0.248331] TCP: reno registered
    [    0.248341] UDP hash table entries: 256 (order: 0, 4096 bytes)
    [    0.248356] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
    [    0.248514] NET: Registered protocol family 1
    [    0.248856] RPC: Registered named UNIX socket transport module.
    [    0.248865] RPC: Registered udp transport module.
    [    0.248871] RPC: Registered tcp transport module.
    [    0.248876] RPC: Registered tcp NFSv4.1 backchannel transport module.
    [    0.249775] hw perfevents: enabled with ARMv7 Cortex-A8 PMU driver, 5 counters available
    [    0.252100] futex hash table entries: 256 (order: -1, 3072 bytes)
    [    0.388708] VFS: Disk quotas dquot_6.5.2
    [    0.388767] Dquot-cache hash table entries: 1024 (order 0, 4096 bytes)
    [    0.389211] NFS: Registering the id_resolver key type
    [    0.389278] Key type id_resolver registered
    [    0.389285] Key type id_legacy registered
    [    0.389316] jffs2: version 2.2. (NAND) (SUMMARY)  © 2001-2006 Red Hat, Inc.
    [    0.389462] msgmni has been set to 995
    [    0.390640] NET: Registered protocol family 38
    [    0.390674] io scheduler noop registered
    [    0.390680] io scheduler deadline registered
    [    0.390705] io scheduler cfq registered (default)
    [    0.392192] pinctrl-single 44e10800.pinmux: 142 pins at pa f9e10800 size 568
    [    0.396477] Serial: 8250/16550 driver, 10 ports, IRQ sharing enabled
    [    0.400859] 44e09000.serial: ttyS0 at MMIO 0x44e09000 (irq = 88, base_baud = 3000000) is a 8250
    [    1.023881] console [ttyS0] enabled
    [    1.028914] omap_rng 48310000.rng: OMAP Random Number Generator ver. 20
    [    1.035935] [drm] Initialized drm 1.1.0 20060810
    [    1.049387] brd: module loaded
    [    1.057040] loop: module loaded
    [    1.060523] (hci_tty): inside hci_tty_init
    [    1.065066] (hci_tty): allocated 250, 0
    [    1.071314] mtdoops: mtd device (mtddev=name/number) must be supplied
    [    1.080797] usbcore: registered new interface driver asix
    [    1.086434] usbcore: registered new interface driver ax88179_178a
    [    1.092716] usbcore: registered new interface driver cdc_ether
    [    1.098748] usbcore: registered new interface driver smsc95xx
    [    1.104653] usbcore: registered new interface driver net1080
    [    1.110480] usbcore: registered new interface driver cdc_subset
    [    1.116549] usbcore: registered new interface driver zaurus
    [    1.122353] usbcore: registered new interface driver cdc_ncm
    [    1.128475] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
    [    1.135058] ehci-pci: EHCI PCI platform driver
    [    1.139690] ehci-omap: OMAP-EHCI Host Controller driver
    [    1.145351] usbcore: registered new interface driver cdc_wdm
    [    1.151202] usbcore: registered new interface driver usb-storage
    [    1.158111] mousedev: PS/2 mouse device common for all mice
    [    1.165297] i2c-core: driver [rtc-ds1307] using legacy suspend method
    [    1.171802] i2c-core: driver [rtc-ds1307] using legacy resume method
    [    1.178915] omap_rtc 44e3e000.rtc: rtc core: registered 44e3e000.rtc as rtc0
    [    1.186741] i2c /dev entries driver
    [    1.190380] Driver for 1-wire Dallas network protocol.
    [    1.197644] omap_wdt: OMAP Watchdog Timer Rev 0x01: initial timeout 60 sec
    [    1.278746] mmc0: host does not support reading read-only switch. assuming write-enable.
    [    1.289046] ledtrig-cpu: registered to indicate activity on CPUs
    [    1.295223] mmc0: new high speed SDHC card at address 59b4
    [    1.301468] omap-aes 53500000.aes: OMAP AES hw accel rev: 3.2
    [    1.307347] mmcblk0: mmc0:59b4 USDU1 14.9 GiB 
    [    1.313838] omap-sham 53100000.sham: hw accel on OMAP rev 4.3
    [    1.319783]  mmcblk0: p1 p2
    [    1.328054] usbcore: registered new interface driver usbhid
    [    1.333731] usbhid: USB HID core driver
    [    1.337848] platform 44d00000.wkup_m3: Driver wkup_m3 requests probe deferral
    [    1.348162] oprofile: using arm/armv7
    [    1.352207] TCP: cubic registered
    [    1.355554] Initializing XFRM netlink socket
    [    1.360870] NET: Registered protocol family 17
    [    1.367404] NET: Registered protocol family 15
    [    1.371991] Key type dns_resolver registered
    [    1.376913] cpu cpu0: of_pm_voltdm_notifier_register: Failed to get cpu0 regulator/voltdm: -517
    [    1.385700] cpu cpu0: cpu0 clock notifier not ready, retry
    [    1.391285] platform cpufreq-cpu0.0: Driver cpufreq-cpu0 requests probe deferral
    [    1.399335] PM: bootloader does not support rtc-only!
    [    1.404506] ThumbEE CPU extension supported.
    [    1.408819] Registering SWP/SWPB emulation handler
    [    1.414989] regulator-dummy: disabling
    [    1.419394] Error: Driver 'tfp410' is already registered, aborting...
    [    1.426252] slave hdmi: could not get i2c
    [    1.430314] platform hdmi: Driver slave requests probe deferral
    [    1.436879] platform 4830e000.lcdc: Driver tilcdc requests probe deferral
    [    1.446633] DCDC1: at 1500 mV 
    [    1.450708] vdd_mpu: 925 <--> 1375 mV at 1325 mV 
    [    1.456501] vdd_core: 925 <--> 1150 mV at 1125 mV 
    [    1.462271] LDO1: at 1800 mV 
    [    1.466192] LDO2: at 3300 mV 
    [    1.470126] LDO3: 1800 mV 
    [    1.473846] LDO4: at 3300 mV 
    [    1.477849] tps65217 0-0024: TPS65217 ID 0xe version 1.2
    [    1.483240] omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
    [    1.489376]  remoteproc0: wkup_m3 is available
    [    1.493886]  remoteproc0: Note: remoteproc is still under development and considered experimental.
    [    1.502894]  remoteproc0: THE BINARY FORMAT IS NOT YET FINALIZED, and backward compatibility isn't yet guaranteed.
    [    1.513444]  remoteproc0: Direct firmware load failed with error -2
    [    1.519753]  remoteproc0: Falling back to user helper
    [    1.525290] cpu cpu0: of_pm_voltdm_notifier_register: Fail calculating voltage latency[950000<->1325000]:-22
    [    1.653916] tilcdc 4830e000.lcdc: found TDA19988
    [    1.659312] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
    [    1.665985] [drm] No driver support for vblank timestamp query.
    [    1.672321] tilcdc 4830e000.lcdc: No connectors reported connected with modes
    [    1.679503] [drm] Cannot find any crtc or sizes - going 1024x768
    [    1.698187] Console: switching to colour frame buffer device 128x48
    [    1.709825] tilcdc 4830e000.lcdc: fb0:  frame buffer device
    [    1.715437] tilcdc 4830e000.lcdc: registered panic notifier
    [    1.721069] [drm] Initialized tilcdc 1.0.0 20121205 on minor 0
    [    1.754857] mmc1: BKOPS_EN bit is not set
    [    1.763229] mmc1: new high speed MMC card at address 0001
    [    1.769193] mmcblk1: mmc1:0001 MMC04G 3.65 GiB 
    [    1.773896] mmcblk1boot0: mmc1:0001 MMC04G partition 1 1.00 MiB
    [    1.779941] mmcblk1boot1: mmc1:0001 MMC04G partition 2 1.00 MiB
    [    1.788198]  mmcblk1: p1 p2
    [    1.791795] davinci_mdio 4a101000.mdio: davinci mdio revision 1.6
    [    1.797923] davinci_mdio 4a101000.mdio: detected phy mask fffffffe
    [    1.805671] libphy: 4a101000.mdio: probed
    [    1.809712] davinci_mdio 4a101000.mdio: phy[0]: device 4a101000.mdio:00, driver SMSC LAN8710/LAN8720
    [    1.818983]  mmcblk1boot1: unknown partition table
    [    1.825508]  mmcblk1boot0: unknown partition table
    [    1.830717] cpsw 4a100000.ethernet: Detected MACID = 6c:ec:eb:b9:df:15
    [    1.841264] omap_rtc 44e3e000.rtc: setting system clock to 2000-01-01 00:00:01 UTC (946684801)
    [    1.853595] ALSA device list:
    [    1.856598]   No soundcards found.
    [    1.863880] EXT4-fs (mmcblk0p2): INFO: recovery required on readonly filesystem
    [    1.871240] EXT4-fs (mmcblk0p2): write access will be enabled during recovery
    [    1.889294] EXT4-fs (mmcblk0p2): recovery complete
    [    1.942351] EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
    [    1.950543] VFS: Mounted root (ext4 filesystem) readonly on device 179:2.
    [    1.961137] devtmpfs: mounted
    [    1.964708] Freeing unused kernel memory: 260K (c07d6000 - c0817000)
    INIT: version 2.88 booting
    Starting udev
    [    2.770464] udevd[857]: starting version 182
    [    3.177129] 47401300.usb-phy supply vcc not found, using dummy regulator
    [    3.227510]  remoteproc0: powering up wkup_m3
    [    3.271553]  remoteproc0: Booting fw image am335x-pm-firmware.elf, size 154412
    [    3.318135] 47401b00.usb-phy supply vcc not found, using dummy regulator
    [    3.371991] PM: CM3 Firmware Version = 0x190
    [    3.380099] cryptodev: driver 1.6 loaded.
    [    3.428637]  remoteproc0: remote processor wkup_m3 is now up
    [    3.757218] EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
    Starting Bootlog daemon: bootlogd: cannot allocate pseudo tty: No such file or directory
    bootlogd.
    [    4.132780] random: nonblocking pool is initialized
    [    4.247486] davinci_evm sound: hdmi-hifi <-> 48038000.mcasp mapping ok
    [    5.503089] musb-hdrc musb-hdrc.1.auto: MUSB HDRC host driver
    [    5.735376] musb-hdrc musb-hdrc.1.auto: new USB bus registered, assigned bus number 1
    [    5.972029] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
    [    5.978865] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    [    5.986145] usb usb1: Product: MUSB HDRC host driver
    [    5.991130] usb usb1: Manufacturer: Linux 3.14.43-g875c69b musb-hcd
    [    5.997432] usb usb1: SerialNumber: musb-hdrc.1.auto
    
    udevadm settle - timeout of 3 seconds reached, the event queue contains:
      /sys/devices/ocp/48060000.mmc/mmc_host/mmc0/mmc0:59b4/block/mmcblk0/mmcblk0p1 (814)
      /sys/devices/ocp/48060000.mmc/mmc_host/mmc0/mmc0:59b4/block/mmcblk0/mmcblk0p2 (815)
      /sys/devices/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1/mmcblk1p1 (829)
      /sys/devices/ocp/481d8000.mmc/mmc_host/mmc1/mmc1:0001/block/mmcblk1/mmcblk1p2 (830)
      /sys/devices/virtual/block/ram1 (971)
      /sys/devices/virtual/block/ram11 (973)
      /sys/devices/virtual/block/ram15 (977)
      /sys/devices/virtual/block/ram5 (981)
      /sys/devices/ocp/47400000.usb/47401400.usb (1002)
      /sys/devices/ocp/47400000.usb/47401c00.usb (1006)
      /sys/devices/ocp/47400000.usb/47400000.dma-controller/dma/dma1chan52 (1060)
    [    6.267504] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [    6.368400] EXT4-fs (mmcblk1p2): recovery complete
    [    6.378049] EXT4-fs (mmcblk1p2): mounted filesystem with ordered data mode. Opts: (null)
    [    6.392785] FAT-fs (mmcblk1p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
    [    6.415491] hub 1-0:1.0: USB hub found
    [    6.440438] hub 1-0:1.0: 1 port detected
    ALSA: Restoring mixer settings...
    No state is present for card Black
    Found hardware: "TI_BeagleBone_B" "" "" "" ""
    Hardware is initialized using a generic method
    No state is present for card Black
    Mon Jul  6 21:02:00 UTC 2015
    INIT: Entering runlevel: 5
    Configuring network interfaces... [    7.347993] net eth0: initializing cpsw version 1.12 (0)
    [    7.432559] net eth0: phy found : id is : 0x7c0f1
    [    7.437344] libphy: PHY 4a101000.mdio:01 not found
    [    7.442172] net eth0: phy 4a101000.mdio:01 not found on slave 1
    udhcpc (v1.22.1) started
    Sending discover...
    Sending discover...
    Sending discover...
    No lease, forking to background
    done.
    Starting system message bus: dbus.
    UIM SYSFS Node Not Found
    Starting Dropbear SSH server: dropbear.
    Starting telnet daemon.
    Starting rpcbind daemon...rpcbind: cannot create socket for udp6
    rpcbind: cannot create socket for tcp6
    done.
    creating NFS state directory: done
    starting statd: done
    Starting syslogd/klogd: done
    Starting thttpd.
    Starting PVR
    Starting Lighttpd Web Server: lighttpd.
    2015-07-06 21:02:11: (/home/gtbldadm/ti/oe-layersetup/build-CORTEX_1/arago-tmp-external-linaro-toolchain/work/cortexa8t2hf-vfp-neon-linux-gnueabi/lighttpd/1.4.33-r1/lighttpd-1.4.33/src/log.c.166) server started 
    /
    Starting Matrix GUI application.
    Enabling thermal zones...
    /etc/rc5.d/S98thermal-zone-init: line 7: /sys/class/thermal/thermal_zone*/mode: No such file or directory
    ***************************************************************
    ***************************************************************
    NOTICE: This file system contains the followin GPLv3 packages:
    	autoconf
    	binutils
    	cpp-symlinks
    	cpp
    	g++-symlinks
    	g++
    	gcc-symlinks
    	gcc
    	gdbserver
    	gstreamer1.0-libav
    	libgmp10
    	libmpc3
    	libmpfr4
    	make
    
    If you do not wish to distribute GPLv3 components please remove
    the above packages prior to distribution.  This can be done using
    the opkg remove command.  i.e.:
        opkg remove <package>
    Where <package> is the name printed in the list above
    
    NOTE: If the package is a dependency of another package you
          will be notified of the dependent packages.  You should
          use the --force-removal-of-dependent-packages option to
          also remove the dependent packages as well
    ***************************************************************
    ***************************************************************
    Stopping Bootlog daemon: bootlogd.
    
     _____                    _____           _         _   
    |  _  |___ ___ ___ ___   |  _  |___ ___  |_|___ ___| |_ 
    |     |  _| .'| . | . |  |   __|  _| . | | | -_|  _|  _|
    |__|__|_| |__,|_  |___|  |__|  |_| |___|_| |___|___|_|  
                  |___|                    |___|            
    
    Arago Project http://arago-project.org am335x-evm /dev/ttyO0
    
    Arago 2015.05 am335x-evm /dev/ttyO0
    
    am335x-evm login: root
    root@am335x-evm:~# [   38.262033] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [   38.381932] usb 1-1: new high-speed USB device number 2 using musb-hdrc
    [   38.523837] usb 1-1: New USB device found, idVendor=05e3, idProduct=0605
    [   38.530604] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [   38.537860] usb 1-1: Product: USB2.0 Hub
    [   38.552729] hub 1-1:1.0: USB hub found
    [   38.561954] hub 1-1:1.0: 4 ports detected
    
    root@am335x-evm:~# [   41.092950] mmcblk0: timed out sending r/w cmd command, card status 0x800900
    [   54.112127] usb 1-1.4: new full-speed USB device number 3 using musb-hdrc
    [   54.213139] usb 1-1.4: device v067b p2303 is not supported
    [   54.218697] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303
    [   54.225684] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [   54.233080] usb 1-1.4: Product: USB-Serial Controller D
    [   54.238348] usb 1-1.4: Manufacturer: Prolific Technology Inc. 
    [   54.276638] usbcore: registered new interface driver usbserial
    [   54.293451] usbcore: registered new interface driver pl2303
    [   54.300913] usbserial: USB Serial support registered for pl2303
    [   54.309780] pl2303 1-1.4:1.0: pl2303 converter detected
    [   54.318903] usb 1-1.4: pl2303 converter now attached to ttyUSB0
    [   55.802133] usb 1-1.1: new full-speed USB device number 4 using musb-hdrc
    [   55.903046] usb 1-1.1: device v067b p2303 is not supported
    [   55.908603] usb 1-1.1: New USB device found, idVendor=067b, idProduct=2303
    [   55.915591] usb 1-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [   55.922985] usb 1-1.1: Product: USB-Serial Controller
    [   55.928078] usb 1-1.1: Manufacturer: Prolific Technology Inc.
    [   55.944181] pl2303 1-1.1:1.0: pl2303 converter detected
    [   55.958774] usb 1-1.1: pl2303 converter now attached to ttyUSB1
    
    root@am335x-evm:~# lsusb
    Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    Bus 001 Device 004: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    Bus 001 Device 003: ID 067b:2303 Prolific Technology, Inc. PL2303 Serial Port
    root@am335x-evm:~# stty -F /dev/ttyUSB0 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
    root@am335x-evm:~#  stty -F /dev/ttyUSB1 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    [  103.951960] pl2303 1-1.1:1.0: pl2303_vendor_write - failed to write [0008]: -110
    [  104.051916] pl2303 1-1.1:1.0: pl2303_vendor_write - failed to write [0009]: -110
    [  104.151886] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
    [  104.251884] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
    [  104.351881] pl2303 1-1.1:1.0: pl2303_vendor_write - failed to write [0000]: -110
    root@am335x-evm:~# 
    
    

  • Roman,

    Though I am unable to replicate the issue yet, I just finished debugging a USB modem issue with hub, and found the following patch causes the issue.

    dd97dc6 usb: musb: musb_host: Enable HCD_BH flag to handle urb return in bottom half

    Can you please revert this patch in your kernel and see if the issue still exists?
  • Hi Bin,

    I have reverted the patch,

    
    
    commit b62bd58969208d35d5e72ec52cb46d5fcf2d8e5d
    
    Date:   Mon Aug 31 19:38:11 2015 +0300
    
        Revert "usb: musb: musb_host: Enable HCD_BH flag to handle urb return in bottom half"
        
        This reverts commit dd97dc60232a7c5019c968c7d5a27d7a2b11761e.
    

    The first transmission was without the error messages but the second iteration faced the same issue.

    However the file was sent without corruption. Tomorrow I will check the behavior with our platform and will update the status. Have you managed to reproduce the issue? at least error messages I posted?


    root@am335x-evm:~# stty -F /dev/ttyUSB0 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
    root@am335x-evm:~# stty -F /dev/ttyUSB1 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    root@am335x-evm:~# cat /dev/ttyUSB0 > fileFromPL1 &
    [1] 1593
    root@am335x-evm:~# cat /bin/bash > /dev/ttyUSB1
    [  235.116603] hrtimer: interrupt took 170416 ns
    root@am335x-evm:~# ls
    fileFromPL1
    root@am335x-evm:~# ls -al fileFromPL1 
    -rw-r--r--    1 root     root        671412 Jul  6 21:06 fileFromPL1
    root@am335x-evm:~# md5sum /bin/bash 
    3de63e1e57c4dfd732c63a31c0461708  /bin/bash
    root@am335x-evm:~# md5sum ./fileFromPL1 
    3de63e1e57c4dfd732c63a31c0461708  ./fileFromPL1
    root@am335x-evm:~# kill -9 1593
    root@am335x-evm:~# cat /dev/ttyUSB1 > fileFromPL0 &
    [2] 1607
    [1]   Killed                  cat /dev/ttyUSB0 > fileFromPL1
    root@am335x-evm:~# [  350.072038] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0008]: -110
    [  350.171961] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0009]: -110
    [  350.271924] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
    [  350.371977] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
    [  350.471897] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0000]: -110
    
    root@am335x-evm:~# uname -a
    Linux am335x-evm 3.14.43-gb62bd58 #3 Mon Aug 31 21:22:17 FET 2015 armv7l GNU/Linux








  • Roman,

    Thanks for the update. It is promising,,,

    I am still unable to see the -110 error message, either does another colleague.

  • Hi Bin,

    Today I have found old-fashioned USB1.0 hub

    root@am335x-evm:~# lsusb

    Bus 001 Device 002: ID 413c:1003 Dell Computer Corp. Keyboard Hub

     

    and the issue didn't take place.

    After that I attached this hub to our am3352 based product and 2 USB-serial devices (we are using)  connected to

    this  hub also worked without issues.  /we faced the same -110 and another issue/

    So I have come to the conclusion that the issue is related either with USB2.0 hub or with

    usb-hub chip manufacturer as all my other hubs (3 items) are based on Genesys Logic as I wrote before.

    Bus 001 Device 002: ID 05e3:0605 Genesys Logic, Inc. USB 2.0 Hub

    or

    Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB

     

    I would point to  Genesys Logic hub chip issue but it is very popular chip and secondly

    I have no issues if I do the same test with IMX or laptop.

    What hub are you using for testing? Is it Genesys Logic? Is it USB2.0 port hub?

    Thanks in advance,

    Roman

  • Roman,

    Can you please re-cap the issue you have after reverted commit dd97dc6? Other than the -110 error, your message is not clear to me if the uart communication passes or not in multiple iterations.

    I have SMSC 2514, CYPress, and other hub in which I don't know the chipsets.
  • Bin,
    you can run lsusb to identify the hub chipset. The issue is clearly reproduced with Genesys Logic.
    As we use the same BBB and the same PL2303, SW is also the same the hub is the only difference.
    I will do my best to find SMSC 2514 or CYPress. Could you please also try to find Genesys Logic (all cheap hubs looks like base on it). Again I would keep it as known issue of the Genesys Logic, if the same hub isn't ok with other platforms (like laptop).
    So I suggest to go on with our efforts.

    As for dd97dc6 reverting,
    on BBB this didn't give any changes in behaviour. The log is the same with and without the patch. PL2303 sends file uncorrupted in both experimets (and in both complains -110 as the log shows).
    e2e.ti.com/.../1615245

    As for our product, we are using another usb-serial and it complains with -110 also (sometimes -32), the bad thing that sometimes this leads to kernel freeze. The issues look related as DELL switch (that is described above) using gives no problems.

    So I believe that solution of the issue with -110 on BBB will fix (at least change) the behaviour of our product.
    Product image build with reverted patch is ongoing (takes some time to make experiment clear) I will update the information asap.
  • Roman,

    I don't think lsusb shows the chipset, it only prints the idVendor field.

    But I found a hub which is from Genesys, and it shows the -110 issue you reported. I will debug it and let you know what I found.

    Do you use a Genesys hub chip on your product? If SMSC or other chipset does not show the issue on your end, will you swap out the Genesys from your board?
  • Hi Bin,

    > I don't think lsusb shows the chipset, it only prints the idVendor field.

    and device (product) ID also

    > But I found a hub which is from Genesys, and it shows the -110 issue you reported. I will debug it and let you know what I found.

    It is good that we have the same results.

    > Do you use a Genesys hub chip on your product? If SMSC or other chipset does not show the issue on your end, will you swap out the Genesys from your board?

    Genesys chip (I have 2 different) based devices are very popular.
    In our design we don't solder the USB-hub chip on a board but use pluggable one depending on concrete application /customer/ of the device.
    The problem is that we don't know the root cause of the issue. Maybe the same issue exists with other chip vendors.
    It is difficult to predict what customer will use in 3 years.

    So writing that "Known issue: platform doesn't work with Genesys-chips-based usb-hub" would be a serious limitation for our platform,
    considering that IMX6 design and X86 board are ok.
  • Roman,

    Here is what I found so far.

    I use the following sequence of commands to trigger the issue.

    # stty -F /dev/ttyUSB0 sane
    # stty -F /dev/ttyUSB1 sane
    # stty -F /dev/ttyUSB0 sane

    The last command triggers the failure, when the pl2303 driver first tries to send a Control transfer (with value 0x0008) to the uart device with the timeout threshold of 100ms.

    But the Genesys hub does not accept the transfer and NAK'ed the data phase of the Control transfer. Then the usb host (am335x) keeps re-sending this Control transfer, but the hub always NAK'ed it, until the 100ms timeout.

    It is legal that the hub NAKs Control transfers when there is no space in the hub internal transaction buffers, but I am not a usb hub expert and unable to explain why the hub has no buffer in this case. I don't see any error in the usb bus trace.
  • Roman,

    It seems this issue is related to kernel pl2303 driver. I found on TI kernel tree the commit 362eb02 (USB: pl2303: add error handling to vendor read and write functions) is the first kernel patch showing this issue. I don't see the issue with kernel at 362eb02^.

    Do you use any high-speed usb device on the AM335x USB host port other than the hub and pl2303? If not, you can force the USB host port to be full-speed only to workaround this issue.
  • Roman,

    Bin Liu said:
    It seems this issue is related to kernel pl2303 driver. I found on TI kernel tree the commit 362eb02 (USB: pl2303: add error handling to vendor read and write functions) is the first kernel patch showing this issue. I don't see the issue with kernel at 362eb02^.

    Sorry I have to take back the statement above, since the -110 error is there even before kernel commit 362eb02. I did not see it that was because there is no such error printk before 362eb02. Commit 362eb02 added these error check. I should have had a cup of coffee when working at midnight...

    Anyway, do you have any issue other than this -110 error messages? I don't see data corruption between /dev/ttyUSB0 and /dev/ttyUSB1 even after the -110 errors in those stty commands.

    Again, please let me know if it is possible to set the USB host port to full-speed only in your use case.

  • Bin,

    Originally we faced the problem with 2 Exar usb-serial devices connected to 1 hub ( Genesys).
    the driver also complained about -110 or (more often) -32. TIme to time this led to kernel freeze.
    When I used two usb ports of our design (ie no external hub) the issue didn't take place.
    After that I looked at reference BBB and found out that it had close problems with 2 usb-serial connected to the hub.
    The same experiments with other boards (freescale, x86) I had were flawless.
    So this is not the PL2303 driver issue as the same driver doesn't show -110 running on IMX.

    I confirm that data transmission is ok with PL2303 though it shows -110.
    But in our case we use Exar devices (as default) and they (looks like) handle the issue with bigger problems.
    Again the same devices with the same driver are ok with IMX.

    So those fact point that either musb or its driver handles smth wrongly.
    (we now know that the issue is reproduced with Genesys chips, at least with described above)

    Am I sure that resolving PL2303 -110 issue will resolve 2Exar+hub+am3352 freeze?

    Nope, but there is a good chance as when I use the Dell hub that doesn't have problems with PL, I also don't face problems with 2Exar+hub+am3352. So I think that issues are connected and the PL is very popular so easier to get.

    > Again, please let me know if it is possible to set the USB host port to full-speed only in your use case.

    Does it solves the -110 issue? What is the method of such change?

    This might be a serious limitation as we develop a platform for 3,5,7 years and it is basis for many customers so it is very difficult to be sure that customers will use only this or those mode or device. That is why we want to have robust and reliable usb and that is why we care about popular Genesys.

    I am happy to assist you in debugging, I can check the behavior with AM3874 board for example (or TI81xx reference). Or try smth else that would be helpful for you.

    Anyway we would like to understand the issue (the root cause) and possible consequences (scope) as it would be very difficult to fix it in the future.

    Thanks,
    Roman
  • Roman,

    Thanks for the clarification, now I understand more about this issue.

    I agree this issue is related to AM335x, but it only happens with Genesys chip, and the usb bus trace does not show any issue until the hub NAKs the IN token of the SETUP packet. I also checked the usb packet timing, but did not see anything obviously wrong.

    We will continue investigating this issue, but we are not sure when the issue will be closed, if even possible, as we don't have visibility to the hub internals.

    When looking for alternatives for your project, if the usb host port is dedicated designed for the usb-uart communication, then I guess you can force the port to full-speed only, as uart does not need usb high-speed. But if your your project indeed needs high-speed, please think if possible to use the 2nd usb port of AM335x for that purpose.

    For testing purpose, you can use the sequence below to set the usb port to full-speed, then plug in the hub.

    If you use USB1 port:
    # echo on > /sys/bus/usb/devices/usb2/power/control
    # devmem2 0x47401c01 b 0xc0

    Or if you use USB0 port:
    # echo on > /sys/bus/usb/devices/usb1/power/control
    # devmem2 0x47401401 b 0xc0

  • Hi Bin,

    Some questions and updates from my side

    1) I have tried the kenel with the reverted patch and don't see any changes in behaviour

    neither BBB with PL2303, nor our platform with XR.

    Do you still recommend to keep it reverted in the product?
    What is wrong with the patch?

    2) I have found a board based on TI Sitara 3874.
    My BSP is rather old and based on TI81XX Linux Platform Support Package (PSP) version 04.04.00.01.
    As far as I understanf the Soc also features Mentor USB (musb)

    root@sa3874i:~# dmesg | grep musb
    musb-hdrc: version 6.0, otg (peripheral+host), debug=0
    ...



    For the test I used the same Genesys Logic hub and 2 PL2303 and I observe no issues.

    So we have TI Platform that suffers from issue and TI platform that doesn't. The controller IP is
    the same, not sure about version. My opinion we should carry on to find the difference to find the
    reason of the difference in behaviour. This could be connected with Mentor IP implementation.

    3) I don't understand the purpose of your suggestion of usb1/2 mode ( full-speed only) change.
    I have tried with BBB but don't see changes in  the described earlier behaviour.
    Please advice.

    Do you have any news?

    Regards,
    Roman

  • Roman,

    Alyautdin Roman said:
    Do you still recommend to keep it reverted in the product?
    What is wrong with the patch?

    Do you mean patch "dd97dc6 usb: musb: musb_host: Enable HCD_BH flag to handle urb return in bottom half"? I would prefer you keep this patch reverted. I did not debug what was exactly wrong with this patch, but it causes a regression - the system hangs once unplug a usb modem in my test. I will soon submit a revert patch to the kernel community to solve the regression.

    Alyautdin Roman said:

    2) I have found a board based on TI Sitara 3874.
    ...
    For the test I used the same Genesys Logic hub and 2 PL2303 and I observe no issues.

    Prior to kernel 3.13.x, the pl2303 driver did not print the error message, the ones you saw in your tests, when the read/write function failed. So I believe that is why you don't see the issue with AM387x.

    The kernel patch "362eb02 USB: pl2303: add error handling to vendor read and write functions" I mentioned earlier adds the error handling in v3.13.x.

    Alyautdin Roman said:
    3) I don't understand the purpose of your suggestion of usb1/2 mode ( full-speed only) change.
    I have tried with BBB but don't see changes in  the described earlier behaviour.
    Please advice.

    Since you did not observe the issue with full-speed hub, we can modify the musb driver to let the musb controller to work in full-speed-only mode, then any high-speed hub will work on full-speed mode, to workaround the issue.

  • Alyautdin Roman said:
    I have tried with BBB but don't see changes in  the described earlier behaviour.
    Please advice.

    Do you mean you tried the two commands to force musb to full-speed only mode, but still see the -110 error messages?

    Has the hub been enumerated as a full-speed device? Please note you have to run the two command before plugging into the hub.

  • Bin Liu said:

    Prior to kernel 3.13.x, the pl2303 driver did not print the error message, the ones you saw in your tests, when the read/write function failed. So I believe that is why you don't see the issue with AM387x.

    The kernel patch "362eb02 USB: pl2303: add error handling to vendor read and write functions" I mentioned earlier adds the error handling in v3.13.x.

    Yes I forgot about the 362eb02, I will update the driver and update the status.

    Bin Liu said:

    Since you did not observe the issue with full-speed hub, we can modify the musb driver to let the musb controller to work in full-speed-only mode, then any high-speed hub will work on full-speed mode, to workaround the issue.

    Current observation is that going full-speed doesn't influence the behaviour, I will double check the workaround tomorrow, but looks like it doesn't work.

  • Bin Liu said:

    Alyautdin Roman
    I have tried with BBB but don't see changes in  the described earlier behaviour.
    Please advice.

    Do you mean you tried the two commands to force musb to full-speed only mode, but still see the -110 error messages?

    Has the hub been enumerated as a full-speed device? Please note you have to run the two command before plugging into the hub.

    Here is the log

    am335x-evm login: root
    root@am335x-evm:~# uname -a
    Linux am335x-evm 3.14.43-g875c69b #1 Mon Jul 6 16:00:11 EDT 2015 armv7l GNU/Linux
    root@am335x-evm:~# lsusb
    Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb1/power/control
    root@am335x-evm:~# devmem2 0x47401401 b 0xc0
    /dev/mem opened.
    Memory mapped at address 0xb6f05000.
    Read at address  0x47401401 (0xb6f05401): 0x20
    Write at address 0x47401401 (0xb6f05401): 0xC0, readback 0xC0
    root@am335x-evm:~# [  160.702042] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [  160.822235] usb 1-1: USB disconnect, device number 2
    [  160.992080] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [  161.112048] usb 1-1: new high-speed USB device number 3 using musb-hdrc
    [  161.253562] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
    [  161.260329] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [  161.267574] usb 1-1: Product: USB2.0 Hub
    [  161.281421] hub 1-1:1.0: USB hub found
    [  161.291073] hub 1-1:1.0: 4 ports detected
    [  161.582298] usb 1-1.2: new full-speed USB device number 4 using musb-hdrc
    [  161.683268] usb 1-1.2: device v067b p2303 is not supported
    [  161.688820] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
    [  161.695810] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  161.703202] usb 1-1.2: Product: USB-Serial Controller
    [  161.708295] usb 1-1.2: Manufacturer: Prolific Technology Inc.
    [  161.773370] usbcore: registered new interface driver usbserial
    [  161.797403] usbcore: registered new interface driver pl2303
    [  161.807683] usbserial: USB Serial support registered for pl2303
    [  161.815955] usb 1-1.4: new full-speed USB device number 5 using musb-hdrc
    [  161.823361] pl2303 1-1.2:1.0: pl2303 converter detected
    [  161.832834] usb 1-1.2: pl2303 converter now attached to ttyUSB0
    [  161.923116] usb 1-1.4: device v067b p2303 is not supported
    [  161.928689] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303
    [  161.935690] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  161.943083] usb 1-1.4: Product: USB-Serial Controller D
    [  161.948351] usb 1-1.4: Manufacturer: Prolific Technology Inc. 
    [  161.964388] pl2303 1-1.4:1.0: pl2303 converter detected
    [  161.978504] usb 1-1.4: pl2303 converter now attached to ttyUSB1
    
    root@am335x-evm:~# stty -F /dev/ttyUSB0 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
    root@am335x-evm:~# stty -F /dev/ttyUSB1 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    [  208.082100] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0008]: -110
    [  208.182140] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0009]: -110
    [  208.282306] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
    [  208.382031] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
    [  208.482026] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0000]: -110
    root@am335x-evm:~# 
    

  • Alyautdin Roman said:
    Yes I forgot about the 362eb02, I will update the driver and update the status.

    You don't have to do anything more about 362eb02, this is the patch adds the error message print. Please don't revert it.

  • Roman,

    Alyautdin Roman said:

    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb1/power/control
    root@am335x-evm:~# devmem2 0x47401401 b 0xc0
    /dev/mem opened.
    Memory mapped at address 0xb6f05000.
    Read at address 0x47401401 (0xb6f05401): 0x20
    Write at address 0x47401401 (0xb6f05401): 0xC0, readback 0xC0
    root@am335x-evm:~# [ 160.702042] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [ 160.822235] usb 1-1: USB disconnect, device number 2
    [ 160.992080] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [ 161.112048] usb 1-1: new high-speed USB device number 3 using musb-hdrc

    You see the log shows the hub is still enumerated as high-speed device. I believe you used the 2nd USB port, but the commands you used are for the first USB port. Please use the following commands before plug in the hub.

    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb2/power/control
    root@am335x-evm:~# devmem2 0x47401c01 b 0xc0

  • Alyautdin Roman said:
    [ 160.822235] usb 1-1: USB disconnect, device number 2

    I am also not sure why you have the disconnect event in the log. Please ensure the hub is not connected when running the two commands.

  • Hi Bin,

    I ported the patch on 2.6.37 kernel (as I have Sitara AM3874 board BSP based on PSP  04.04.00.01)
    With the patch (attached, sorry for .txt but the forum doesn't allow to attach .patch) that handles -110 error the behaviour of the AM3874 is the same as
    BBB. Genesys Logic + PL2303 give -110.

    Does it mean that this is MUSB-controller issue?

    Regards,
    Roman

     

    pl2303-adderrorhandling.txt
    diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
    index 8ae4c6c..61cc887 100644
    --- a/drivers/usb/serial/pl2303.c
    +++ b/drivers/usb/serial/pl2303.c
    @@ -157,23 +157,41 @@ struct pl2303_private {
     static int pl2303_vendor_read(__u16 value, __u16 index,
     		struct usb_serial *serial, unsigned char *buf)
     {
    +	struct device *dev = &serial->interface->dev;
     	int res = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
     			VENDOR_READ_REQUEST, VENDOR_READ_REQUEST_TYPE,
     			value, index, buf, 1, 100);
    +	if (res != 1) {
    +		dev_err(dev, "%s - failed to read [%04x]: %d\n", __func__,
    +								value, res);
    +		if (res >= 0)
    +			res = -EIO;
    +
    +		return res;
    +	}			
     	dbg("0x%x:0x%x:0x%x:0x%x  %d - %x", VENDOR_READ_REQUEST_TYPE,
     			VENDOR_READ_REQUEST, value, index, res, buf[0]);
    -	return res;
    +	return 0;
     }
     
     static int pl2303_vendor_write(__u16 value, __u16 index,
     		struct usb_serial *serial)
     {
    +	struct device *dev = &serial->interface->dev;
    +	
    +	
     	int res = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
     			VENDOR_WRITE_REQUEST, VENDOR_WRITE_REQUEST_TYPE,
     			value, index, NULL, 0, 100);
    +	if (res) {
    +		dev_err(dev, "%s - failed to write [%04x]: %d\n", __func__,
    +								value, res);
    +		return res;
    +	}
    +			
     	dbg("0x%x:0x%x:0x%x:0x%x  %d", VENDOR_WRITE_REQUEST_TYPE,
     			VENDOR_WRITE_REQUEST, value, index, res);
    -	return res;
    +	return 0;
     }
     
     static int pl2303_startup(struct usb_serial *serial)
    @@ -837,6 +855,7 @@ static int __init pl2303_init(void)
     	if (retval)
     		goto failed_usb_register;
     	printk(KERN_INFO KBUILD_MODNAME ": " DRIVER_DESC "\n");
    +	printk(KERN_INFO KBUILD_MODNAME ": TI MUSB debugging version\n");
     	return 0;
     failed_usb_register:
     	usb_serial_deregister(&pl2303_device);
    

  • Bin Liu said:

    Roman,

    Alyautdin Roman

    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb1/power/control
    root@am335x-evm:~# devmem2 0x47401401 b 0xc0
    /dev/mem opened.
    Memory mapped at address 0xb6f05000.
    Read at address 0x47401401 (0xb6f05401): 0x20
    Write at address 0x47401401 (0xb6f05401): 0xC0, readback 0xC0
    root@am335x-evm:~# [ 160.702042] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [ 160.822235] usb 1-1: USB disconnect, device number 2
    [ 160.992080] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [ 161.112048] usb 1-1: new high-speed USB device number 3 using musb-hdrc

    You see the log shows the hub is still enumerated as high-speed device. I believe you used the 2nd USB port, but the commands you used are for the first USB port. Please use the following commands before plug in the hub.

    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb2/power/control
    root@am335x-evm:~# devmem2 0x47401c01 b 0xc0

    The log provided in  is from BBB, so there is no usb2 device.

    Arago 2015.05 am335x-evm /dev/ttyO0
    
    am335x-evm login: root
    root@am335x-evm:~# 
    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb1/power/control
    root@am335x-evm:~# echo on > /sys/bus/usb/devices/usb2/power/control
    -sh: /sys/bus/usb/devices/usb2/power/control: No such file or directory
    root@am335x-evm:~# devmem2 0x47401401 b 0xc0
    /dev/mem opened.
    Memory mapped at address 0xb6f42000.
    Read at address  0x47401401 (0xb6f42401): 0x20
    Write at address 0x47401401 (0xb6f42401): 0xC0, readback 0xC0
    root@am335x-evm:~# [  356.892124] musb-hdrc musb-hdrc.1.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
    [  357.012101] usb 1-1: new high-speed USB device number 2 using musb-hdrc
    [  357.153647] usb 1-1: New USB device found, idVendor=05e3, idProduct=0608
    [  357.160421] usb 1-1: New USB device strings: Mfr=0, Product=1, SerialNumber=0
    [  357.167665] usb 1-1: Product: USB2.0 Hub
    [  357.182213] hub 1-1:1.0: USB hub found
    [  357.191575] hub 1-1:1.0: 4 ports detected
    [  357.482325] usb 1-1.2: new full-speed USB device number 3 using musb-hdrc
    [  357.583291] usb 1-1.2: device v067b p2303 is not supported
    [  357.588844] usb 1-1.2: New USB device found, idVendor=067b, idProduct=2303
    [  357.595832] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  357.603234] usb 1-1.2: Product: USB-Serial Controller
    [  357.608328] usb 1-1.2: Manufacturer: Prolific Technology Inc.
    [  357.672795] usbcore: registered new interface driver usbserial
    [  357.696426] usbcore: registered new interface driver pl2303
    [  357.703220] usb 1-1.4: new full-speed USB device number 4 using musb-hdrc
    [  357.714985] usbserial: USB Serial support registered for pl2303
    [  357.723239] pl2303 1-1.2:1.0: pl2303 converter detected
    [  357.731806] usb 1-1.2: pl2303 converter now attached to ttyUSB0
    [  357.813360] usb 1-1.4: device v067b p2303 is not supported
    [  357.818931] usb 1-1.4: New USB device found, idVendor=067b, idProduct=2303
    [  357.825925] usb 1-1.4: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    [  357.833328] usb 1-1.4: Product: USB-Serial Controller D
    [  357.838597] usb 1-1.4: Manufacturer: Prolific Technology Inc. 
    [  357.848027] pl2303 1-1.4:1.0: pl2303 converter detected
    [  357.857029] usb 1-1.4: pl2303 converter now attached to ttyUSB1
    
    root@am335x-evm:~# stty -F /dev/ttyUSB0 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB0 115200 cs8 raw -echo -crtscts clocal
    root@am335x-evm:~# stty -F /dev/ttyUSB1 sane
    root@am335x-evm:~# stty -F /dev/ttyUSB1 115200 cs8 raw -echo -crtscts clocal
    [  445.302106] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0008]: -110
    [  445.402084] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0009]: -110
    [  445.502074] pl2303 ttyUSB1: pl2303_get_line_request - failed: -110
    [  445.602061] pl2303 ttyUSB1: pl2303_set_line_request - failed: -110
    [  445.702062] pl2303 1-1.4:1.0: pl2303_vendor_write - failed to write [0000]: -110
    root@am335x-evm:~# 
    

  • With our AM3352 board I don't reproduce the issue with XR if full-speed mode is running.

    So for now we know that
    This issue is common for AM3352, AM3359 and AM3874 + Genesys Logic hub
    Using full-speed leads to normal operation at least Exar USB-serial (although PL2303 driver still complains)

    Do you have any ideas regarding solving the issue, looks like it is already limited.
    Maybe it is worth to invite Mentor?
  • Roman,

    We understood the issue only happens with MUSB controller on AM335x or AM387x, but only with Genesys hub. The bus trace does not show anything obviously illegal from the usb host, so I don't think we have enough data to get Mentor invloved at this moment, and I would think Genesys could explain why the hub NAKs the IN token of the SETUP packets.

  • Bin,
    We also know that laptop usb HC and IMX6 HC are ok with the same Genesys hub.
    This doesn't mean that issue is not inside Genesys chips, but it is hard to explain why TI (MUSB) is the only platform to reproduce the issue.
    Genesys guys will forward me back as they will show 10+ HC platforms that are ok.
    More over MUSB is ok if full-speed is used. Hence this points that in high-speed smth goes wrong, time delays are not kept or smth like this.
    Isn't that enough to have Mentor comments?
    The thing we need for our product is to understand the risks and trade-offs, to describe them and to prevent possible issue in the future.
    And for this we should have the description of the rootcause.
  • Roman,

    No matter how many working cases we have, it does not explain the root cause of the failure case. We don't have the visibility why the Genesys hub NAKs the IN token, so if Genesys could review the bus trace and point to the illegal packet from the host which causes the hub to NAK, that would help the issue moving forward.