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.

AM5728: AM5728: USB XHCI problem in kernel modul

Part Number: AM5728

Hi,

I start my buildroot-linux on a custom board and it can be that it starts four, five or six times well that means all usb devices are there:

lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 012: ID 1546:01a8 U-Blox AG [u-blox 8]
Bus 003 Device 005: ID 0424:2422 Standard Microsystems Corp.  
Bus 003 Device 009: ID 1fc9:0103 NXP Semiconductors  
Bus 003 Device 007: ID 1546:1143 U-Blox AG  
Bus 003 Device 002: ID 0424:2517 Standard Microsystems Corp. Hub
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:5744 Standard Microsystems Corp.  
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0424:2744 Standard Microsystems Corp.  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Another time some of the devices are absent:

lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 002: ID 0424:5744 Standard Microsystems Corp.  
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 0424:2744 Standard Microsystems Corp.  
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

In this case during the start procedure an error occurs:

[   85.043982] xhci-hcd xhci-hcd.1.auto: ERROR mismatched command completion event, cmd_dma: 4249149424, cmd_dequeue_dma: 4249145344

The error comes from the file "xhci-ring.c" in a kernel modul. I printed the both adresses to see why the error occurs, if they are equal there is no error.

How can it be that the error only occurs at nearly every fourth or fiifth start? What reasons are for the difference of the addresses? It looks to me like a ring buffer and some entries are displaced but why?

Regards,

Ralph

[   85.043982] xhci-hcd xhci-hcd.1.auto: ERROR mismatched command completion event, cmd_dma: 4249149424, cmd_dequeue_dma: 4249145344

  • Hi Ralph,

    Could you please provide the SDK version or the kernel version that you are using? 

    Is the same behavior seen on the AM57xx EVM and do you have the ability to test this and provide feedback?

    Regards

    Karthik

  • Hi Karthik,

    the kernel version is 4.19.38, the buildroot version buildroot-2019.02.11.

    I'll try to test the AM57xx EVM you mentioned.

    Regards

    Ralph

  • Hi Karthik,

    here are some complementary information about the board and the very early start.
    In every case the board boots, there is no restart during booting.

    U-Boot SPL 2019.01 (Apr 23 2021 - 10:30:36 +0200)
    DRA752-GP ES2.0
    Logic Way NetMobilBox configuration
    Trying to boot from MMC1
    no pinctrl state for default mode
    no pinctrl state for default mode
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    Loading Environment from MMC... *** Warning - bad CRC, using default environment



    U-Boot 2019.01 (Apr 23 2021 - 10:30:36 +0200)

    CPU  : DRA752-GP ES2.0
    Model: PHYTEC phyCORE-AM5716 with 1GiB DDR3 (1 bank), Commercial Temp
    Board: phyCORE-AM57x kit
    DRAM:  2 GiB
    MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
    Loading Environment from FAT... *** Warning - bad CRC, using default environment

    Loading Environment from MMC... *** Warning - bad CRC, using default environment

    Warning: fastboot.board_rev: unknown board revision
    Net:    
    Warning: ethernet@48484000 using MAC address from ROM
    eth0: ethernet@48484000
    Hit any key to stop autoboot:  0  
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    ** Unable to read file boot.scr **
    ** Unable to read file uEnv.txt **
    switch to partitions #0, OK
    mmc0 is current device
    SD/MMC found on device 0
    5755392 bytes read in 253 ms (21.7 MiB/s)
    141949 bytes read in 8 ms (16.9 MiB/s)
    ## Flattened Device Tree blob at 88000000
      Booting using the fdt blob at 0x88000000
      Loading Device Tree to 8ffda000, end 8ffffa7c ... OK

    Starting kernel ...

    [    0.000000] Booting Linux on physical CPU 0x0
    [    0.000000] Linux version 4.19.38 (ralph@ralph) (gcc version 7.4.0 (Buildroot 2019.02.11)) #4 SMP PREEMPT Thu Apr 22 08:53:52 CEST 2021
    [    0.000000] CPU: ARMv7 Processor [412fc0f2] revision 2 (ARMv7), cr=30c5387d
    [    0.000000] CPU: div instructions available: patching division code
    [    0.000000] CPU: PIPT / VIPT nonaliasing data cache, PIPT instruction cache
    [    0.000000] OF: fdt: Machine model: PHYTEC phyCORE-AM5728 with 2GiB (banks) DDR3, Industrial Temp

    Regards,

    Ralph

  • Hi Karthik,

    which article do you mean,"AM5728: USB XHCI problem in U-boot" or another one?

    Booting is successful in every case but from time to time that not all usb devices involved.

    Regards,

    Ralph

  • Hi Karthik,

    I have a longer snippet from start log file, maybe it helps to find the error. The "No /dev/ttyM8P ...." lines come from me.

    No /dev/ttyM8P after 41 seconds, please wait!
    No /dev/ttyM8P after 42 seconds, please wait!
    No /dev/ttyM8P after 43 seconds, please wait!
    [   90.164260] xhci-hcd xhci-hcd.1.auto: ERROR mismatched command completion event
    [   90.164273] xhci-hcd xhci-hcd.1.auto: Timeout while waiting for setup device command
    [   90.394243] usb 3-1.7.1: device not accepting address 10, error -62
    [   90.400817] usb 3-1.7-port1: unable to enumerate USB device
    No /dev/ttyM8P after 44 seconds, please wait!
    No /dev/ttyM8P after 45 seconds, please wait!
    [   92.244256] xhci-hcd xhci-hcd.1.auto: Error while assigning device slot ID
    [   92.251168] xhci-hcd xhci-hcd.1.auto: Max number of devices this xHCI host supports is 64.
    [   92.259727] usb 3-1.7-port2: couldn't allocate usb_device
    No /dev/ttyM8P after 46 seconds, please wait!
    No /dev/ttyM8P after 47 seconds, please wait!
    No /dev/ttyM8P after 48 seconds, please wait!
    No /dev/ttyM8P after 49 seconds, please wait!
    No /dev/ttyM8P after 50 seconds, please wait!
    [   97.284225] xhci-hcd xhci-hcd.1.auto: xHCI host not responding to stop endpoint command.
    [   97.307523] xhci-hcd xhci-hcd.1.auto: xHCI host controller not responding, assume dead
    [   97.315489] LLC_USBInUrbCallback: URB failed -108
    [   97.320225] LLC_USBInUrbCallback: URB failed -108
    [   97.324953] LLC_USBInUrbCallback: URB failed -108
    [   97.329683] LLC_USBInUrbCallback: URB failed -108
    [   97.334410] LLC_USBInUrbCallback: URB failed -108
    [   97.339138] LLC_USBInUrbCallback: URB failed -108
    [   97.343865] LLC_USBInUrbCallback: URB failed -108
    [   97.348591] LLC_USBInUrbCallback: URB failed -108
    [   97.353342] xhci-hcd xhci-hcd.1.auto: HC died; cleaning up
    [   97.358932] usb 3-1: USB disconnect, device number 2
    [   97.363925] usb 3-1.1: USB disconnect, device number 6
    [   97.370261] cdc_ether 3-1.1:1.0 wwan0: unregister 'cdc_ether' usb-xhci-hcd.1.auto-1.1, Mobile Broadband Network Device
    [   97.430170] usb 3-1.3: USB disconnect, device number 8
    [   97.449939] usb 3-1.7: USB disconnect, device number 4
    No /dev/ttyM8P after 51 seconds, please wait!
    No /dev/ttyM8P after 52 seconds, please wait!
    No /dev/ttyM8P after 53 seconds, please wait!

    It seems to me there is a problem with xHCI host controller.

    Regards,

    Ralph

  • Hi Karthik,

    changing from kernel version 4.19.38 to 4.19.79 increases the "good" start attempts. About every 10th was negativly but why?

    Regards

    Ralph

  • Hi Ralph,

    From the information that you are providing, there is really not much of information that I can use to investigate further.

    I notice that you are using the Phytec Core for this. Have you tried to contact Phytec team for support? Perhaps they may have some familiarity with this problem.

    Regards

    Karthik