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.

Linux: AM335x issue with USB Hub

Tool/software: Linux

Dear TI expert,

On our board,we used the usb hub chip 2514  to separate two usb ports. 2514 is connected to USB0. When I plug in the USB flash drive and pull out when a line appears, or plugged frequently,the following print message will appear all the time.

[ 127.000885] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 127.120767] usb 1-1: new high-speed USB device number 2 using musb-hdrc
[ 127.580803] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 127.700783] usb 1-1: new high-speed USB device number 3 using musb-hdrc
[ 128.160817] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 128.281002] usb 1-1: new high-speed USB device number 4 using musb-hdrc
[ 128.700920] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 128.820803] usb 1-1: new high-speed USB device number 5 using musb-hdrc
[ 129.350844] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 129.470783] usb 1-1: new high-speed USB device number 6 using musb-hdrc
[ 129.930848] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 130.051048] usb 1-1: new high-speed USB device number 7 using musb-hdrc
[ 130.510970] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 130.630788] usb 1-1: new high-speed USB device number 8 using musb-hdrc
[ 131.050864] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device
[ 131.170766] usb 1-1: new high-speed USB device number 9 using musb-hdrc
[ 131.700874] musb-hdrc musb-hdrc.0.auto: otg: usb_otg_kick_fsm: invalid host/gadget device

the process is am335x,the kernel is  3.14.43.  and I found  3.2.0 do not have this problem. we would not  update to the latest SDK, Is there a patch for this problem?

  • Hi,

    The log means the hub is not enumerated properly. But there are many things could go wrong, so it is difficult to tell what the root cause is and how to fix it without any further investigation.

    Unfortunately v3.14.43 is an old kernel and no longer supported in this forum. You could
    1. post the usb portion of the schematics, we can check if there is any obvious design mistake;
    2. connect the 2514 hub on any TI AM335x EVM, for example, BeagleboneBlack with kernel v3.14.43 to do the same test to see if the issue also happens. If so, then test with the latest SDK to see if it is kernel bug.
  • Dear Bin,

    I  think schematics is ok, This board has been used by many customers. Previously it was the 3.2 kernel. Without this problem. only appeared in  3.14.43. I reset the USB HUB and it will return to normal.

    The crystal oscillator does not have a clock until it is plugged into a USB flash drive. Can I keep the HUB working all the time? In the menuconfig, can not find USB runtime power management (autosuspend)

  • Hi,

    chupf said:
    I reset the USB HUB and it will return to normal.

    How did you reset the hub? This does sound like hw problem there - the hub shouldn't need reset.

    chupf said:
    The crystal oscillator does not have a clock until it is plugged into a USB flash drive.

    Which crystal? Not the main oscillator of AM335x, right?

    chupf said:
    Can I keep the HUB working all the time?

    I don't know because we don't know why and how the hub is not working.

    chupf said:
    In the menuconfig, can not find USB runtime power management (autosuspend)

    To disable usb autosuspend, you can add 'usbcore.autosuspend=-1' in your uboot bootargs parameter.

  • Dear Bin,

    Thanks for your reply.  the schematics  is like this.

    When the problem occurs, I pull GPIO_HUB_nRST low, then pull it high, and HUB can re-recognize the U disk.

    The  crystal oscillator is X2——24MHz ,I compared the kernel of 3.2.0, this clock is always there.

    I tried to add  'usbcore.autosuspend=-1' to bootargs, but it didn't work.

  • Hi,

    Can you please provide the schematic of the usb portion on AM335x side?

    If the USB0_ID and USB1_ID signal on the last picture above is the usb pins on AM335x, the 1K resister is too much, it should be less than 100ohm.

    Please run the following command on your board after booted and provided the output, I'd like to check if you set the parameter correctly.

    # cat /proc/cmdline
  • Dear Bin,

    Thank you for your reply, you reminded me, I did not use bootargs, I added to mmc_bootargs, retested, the problem disappeared. I wonder why there is no problem with auto suspend shutting down?Can I modify the driver to solve it?

  • Hi,

    Glad to hear that disabling autosuspend solves the issue.

    One of the differences between kernel v3.2 and newer kernels for usb is that v3.2 has usb autosuspend disabled by default, but newer kernels have it enabled by default. So there is possible that there is a driver bug in usb runtime power management which breaks the usb function.

    Please check if your kernel has the patch mentioned in item #8.2 in the wiki page below. If not, please apply the patch to see if it solves the issue with usb autosuspend enabled.

    processors.wiki.ti.com/.../Sitara_Linux_MUSB_Issues
  • Dear Bin,

    The patch in the URL could not be opened, but I found these patches. All of them have been already applied to AMSDK 08.00.00.00.

    anyway,thank you for your support!

  • Hi,

    Do you mean your kernel already has all the patches, but the issue still happens when not disabling autosuspend in uboot bootargs? If so, it sounds like there is an unknown bug in the old kernel. disabling autosuspend would be your only solution if you don't update to the latest SDK.

  • Hi,

    Yes, all the patches have been marked.