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/PROCESSOR-SDK-AM335X: USB errors

Part Number: PROCESSOR-SDK-AM335X


Tool/software: Linux

We have a board using an am335x processor and running the 3.12.10 kernel included in the TISDK 7.0.  We have 2 USB ports on our board, a host and device.  The host port can be setup to run IP across it and it makes use of the g_ether driver.  We have noticed that on some of our boards, when they boot up and have a USB device connected to the USB host port we get this in the /var/log/messages file:

Aug 22 15:51:18 Node00b01973d808 daemon.err udevd[870]: worker [873] timeout, kill it 
Aug 22 15:51:18 Node00b01973d808 daemon.err udevd[870]: seq 1256 '/devices/ocp.2/47400000.usb/47401400.usb/musb-hdrc.0.auto/gadget/net/usb1' killed 

Aug 22 15:51:18 Node00b01973d808 daemon.err udevd[870]: worker [873] terminated by signal 9 (Killed)

And the usb1 port is never setup and no IP traffic goes across it.  What may cause this and how can we fix it? 

  • Hi Tim,

    First of all, SDK 7.0 is an old release and no longer supported in this forum. But I'd like to understand more about your use case to see if we can figure out the problem without much debugging, otherwise you would have to test the latest SDK release to see if the problem still exist.

    Tim Potter said:
    We have 2 USB ports on our board, a host and device.

    Which port is the host and which is the device? USB0 vs USB1 (or musb-hdrc.0.auto vs musb-hdrc.1.auto). Are the dr_mode set to "host" and "peripheral" for the corresponding usb port in dts?

    Tim Potter said:
    The host port can be setup to run IP across it

    means a USB network dongle is attached to the host port?

    Tim Potter said:
    and it makes use of the g_ether driver

    What does it mean? Why the host port needs a gadget driver? Or the USB device attached is another board running g_ether gadget driver?

    Tim Potter said:
    And the usb1 port is never setup and no IP traffic goes across it. 

    When this happens, is the usb device already attached to the usb1 (host port?) port before booted the board? If so, is the usb functional if detach and re-attach the device again?

    Have you tried to disable MUSB CPPI DMA to see if the issue also happens?

  • Hello,

    Which port is the host and which is the device?  USB1 is the host port, USB0 is the device port.

    means a USB network dongle is attached to the host port? - No.  We have another of our boards with an am335x chip directly connected to it.  In this connection it would function just like a standard Ethernet connection but using IP over USB.

    What does it mean? Why the host port needs a gadget driver? - Sorry this could be my lack of understanding.  When the two boards are connected they use g_ether to setup the IP communication between them ( or so I thought ).

    When this happens. the usb device is already attached to the usb1 (host port?) port before booted the board? Correct, the two boards are attached as the they are booted up.

    is the usb functional if detach and re-attach the device again? - Yes, if you then unplug the USB connection and reattach it, they come up and function normally.

    Have you tried to disable MUSB CPPI DMA to see if the issue also happens? - No I have not.  Did not know this was a possible solution.  Not sure of the long term ramifications of disabling DMA.  What sort of impact does this have on system performance?

    SDK 7.0 is an old release and no longer supported in this forum. - Is there another forum I where I should post these questions?

  • Tim,

    Tim Potter said:
    What does it mean? Why the host port needs a gadget driver? - Sorry this could be my lack of understanding.  When the two boards are connected they use g_ether to setup the IP communication between them ( or so I thought ).

    Okay, I think I understand the case is that an am335x board usb port loaded with g_ether driver is attached to the usb host port of another am335x board.

    Tim Potter said:

    is the usb functional if detach and re-attach the device again? - Yes, if you then unplug the USB connection and reattach it, they come up and function normally.

    Have you tried to disable MUSB CPPI DMA to see if the issue also happens? - No I have not.  Did not know this was a possible solution.  Not sure of the long term ramifications of disabling DMA.  What sort of impact does this have on system performance?

    This does sound like a timing related, which is when the usb host and device enable their usb port. I don't think the CPPI DMA would be relevant in this case.

    Other than the syslog messages you provided in your first post, does the syslog have any other kernel messages related to the usb enumeration? Or do you have an usb protocol analyzer to capture the usb bus traffic during the two boards booting?

    Tim Potter said:
    SDK 7.0 is an old release and no longer supported in this forum. - Is there another forum I where I should post these questions?

    Sorry, I didn't state it accurately. There are two channels you can get support.

    1. The Sitara devices (including am335x) are supported in this e2e forum, but software related queries are only supported in the Processor SDK releases which are less than two years old. So you either reproduce the issue in the latest SDK,

    2. or if you cannot test on the latest SDK for any reason, please escalate the issue to local TI contact.

  • You have the setup correct. :)

    Yeah, sounded like a timing issue to me as well. Saw this thread:

    e2e.ti.com/.../448159

    Going to test the suggested changes to the timeout value in the udev startup and see if that helps.

    Other messages in log file:

    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.055378] usb usb2: New USB device found, idVendor=1d6b, idProduct=0002
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.062602] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.070199] usb usb2: Product: MUSB HDRC host driver
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.075402] usb usb2: Manufacturer: Linux 3.12.10-Edwards.00.00.24-ti2013.12.01 musb-hcd
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.083903] usb usb2: SerialNumber: musb-hdrc.1.auto
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.141141] hub 2-0:1.0: USB hub found
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.172719] hub 2-0:1.0: 1 port detected
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.231578] device lo entered promiscuous mode
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.588195] usb 2-1: new high-speed USB device number 2 using musb-hdrc
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.738683] usb 2-1: New USB device found, idVendor=0525, idProduct=a4a2
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.749424] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.757225] usb 2-1: Product: RNDIS/Ethernet Gadget
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.762352] usb 2-1: Manufacturer: Linux 3.12.10-Edwards.00.00.24-ti2013.12.01 with musb-hdrc
  • Tim,

    Tim Potter said:
    e2e.ti.com/.../448159

    Going to test the suggested changes to the timeout value in the udev startup and see if that helps.

    Thanks for mentioning this thread. I wasn't aware it.

    Tim Potter said:
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.588195] usb 2-1: new high-speed USB device number 2 using musb-hdrc
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.738683] usb 2-1: New USB device found, idVendor=0525, idProduct=a4a2
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.749424] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
    Jun 7 16:12:24 Node00b01973d7c0 user.info kernel: [ 7.757225] usb 2-1: Product: RNDIS/Ethernet Gadget

    Wait a minute, this log shows the g_ether usb device is enumerated (I thought the enumeration failed due to timing...).

    When the issue happens after boot up, does 'lsusb' command on the host show the device '0525:a4a2'? If so, the hardware and kernel don't have problem, it sounds like just the udev timing, the e2e thread you mentioned above could be the solution.

  • Hi Tim,

    I haven’t heard back from you, I’m assuming you were able to resolve your issue. If not, just post a reply below (or create a new thread if the thread has locked due to time-out). thanks.
  • Hi,

    No the issue is not resolved.  Setting --timeout=3 to --timeout=4 did not resolve it.  We still experienced udev worker timeouts.  Setting it to --timeout=0 introduced many other issues so I don't think we want to go that way.  I have not had a chance to try any values larger than 4 yet.

  • Tim,

    When the issue happens (udev error and IP doesn't communicate), does lsusb command list the usb device '0525:a4a2'? I'd like to understand if the issue is caused in kernel.