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.

Bluetooth over usb issues in SDK 7.0

Other Parts Discussed in Thread: AM3358

Hi !

I am facing timeout and packet corruption errors on the Bluetooth over usb in our custom board (AM3358) when we use the kernel from TI's SDK 7.0.

I think the issues are mentioned in the Release Notes : D-01241 , D-01543.  Please find the logs below..

[ 123.336077] Bluetooth: hci0 command 0x0c12 tx timeout
[ 125.344160] Bluetooth: hci0 command 0x080f tx timeout
[ 125.351713] Bluetooth: unknown link type 32
[ 127.352077] Bluetooth: hci0 command 0x2008 tx timeout
[ 127.358064] Bluetooth: unknown link type 32

I get the below error when data transfer..

[ 581.644802] Bluetooth: hci0 corrupted ACL packet
[ 581.650567] Bluetooth: bad checksum in packet
[ 593.652263] Bluetooth: hci0 corrupted ACL packet
[ 606.676114] Bluetooth: hci0 corrupted ACL packet
[ 616.668546] Bluetooth: hci0 corrupted ACL packet
[ 628.676116] Bluetooth: hci0 corrupted ACL packet
[ 641.683358] Bluetooth: hci0 corrupted ACL packet.

I do not see these issues and bluetooth works perfectly when i get the 3.12.10 or 3.12.31 mainline kernel and use it.

TI has changed the clocks and introduced a new DMA for the USB in the SDK7.0 and we think is what is causing the issue. I have read in one of the forum that TI is planning to release a new SDK sometime in the year end and have fixed the throughput issues in USB. Is there any date on the release or if anyone can recommend a fix it would help us. 

Thanks and appreciate any help.

Harsha Kiran KJ
Software engineer II
ABB Inc.
7051 Industrial Boulevard
74006, Bartlesville, Oklahoma, UNITED STATES
Phone: +1 9183354851
Mobile: +1 4053854043
email: kj.h.kiran@us.abb.com

  • Harsha,

    The SDK7.0 kernel has a few issues in the usb drivers. But it is hard to tell the problem without debug details. The following wiki has a list of known issues and the solution. Please review them to see if there is one can fix your problem.

    http://processors.wiki.ti.com/index.php/Sitara_Linux_SDK_MUSB_Issues
  • Hi Liu,

    Thanks for the reply. Yes, it solved our problem.

    But, it looks like (3) Kernel crashes if unplug a USB device while a USB transfer is till active. ) patch is not working . if i disconnect my bluetooth dongle in the middle of transfer, the kernel crashes.

    Thanks,
    Harsha
  • Harsha,

    Harsha Kiran said:
    Thanks for the reply. Yes, it solved our problem.

    Do you mind to share which patch fixes it? or you applied them all?

    Harsha Kiran said:
    But, it looks like (3) Kernel crashes if unplug a USB device while a USB transfer is till active. ) patch is not working . if i disconnect my bluetooth dongle in the middle of transfer, the kernel crashes.

    Can you please provide more detail about the crash? Does it happen before apply patch(es)? or any patch from the wiki introduced the crash? Please share the crash log.

  • I think this is the problem we had and the below patch fixed it.

    4. Fix RX short packet handling in host mode
    Solution: Apply Daniel Mack's patch [usb: musb: introduce dma_channel.rx_packet_done]. This patch is available in mainline kernel v3.14.

    The crash problem was there before applying the patch (3). Applying the patch did not fix it..
    Here are the logs..

    I have enabled the support for debugfs in kernel and monitoring the logs from musb_core.c file.

    To enable the debugfs:
    ------------------------------------
    echo 8 > /proc/sys/kernel/printk
    mount -t debugfs none /sys/kernel/debug/
    echo 'file musb_core.c +p' > /sys/kernel/debug/dynamic_debug/control

    Logs:
    ------------

    Apparently there is no crash logs from kernel but the system becomes non responsive and restarts after some time.


    # [ 107.764784] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b9880
    [ 107.773182] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.780525] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 10 buf cf5bdf08
    [ 107.788640] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.795977] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.805857] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b9d80
    [ 107.814270] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.821530] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 5 buf cf5bdb08
    [ 107.829565] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.836859] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.856886] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b9d80
    [ 107.865459] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.872798] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 6 buf cf5bdf08
    [ 107.880817] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.888254] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.983521] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b9d80
    [ 107.991787] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 107.999094] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 12 buf cf652d08
    [ 108.007217] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.014509] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.419805] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b9dc0
    [ 108.428165] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.435411] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 9 buf cf652e08
    [ 108.443435] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.450693] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.730499] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b8200
    [ 108.738782] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.746084] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 64 buf cf66ba08
    [ 108.754263] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.761526] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 64 buf cf66ba48
    [ 108.770113] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.777434] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 64 buf cf66ba88
    [ 108.785723] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.792975] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 59 buf cf66bac8
    [ 108.801180] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.808451] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.821110] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 8 buf cf6b8200
    [ 108.829384] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.836706] musb-hdrc musb-hdrc.1.auto: TX ep0 fifo d08b4c20 count 3 buf cf6b8248
    [ 108.844726] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    [ 108.852027] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0000 tx0001 rx0000
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    #
    (************************** SYSTEM NON RESPONSIVE BUT STILL GIVES THESE MESSAGES WHEN CONNECTING AND DISCONNECTING AND THEN RESTARTS**********************************)
    [ 145.519401] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0020 tx0000 rx0000
    [ 145.526721] musb-hdrc musb-hdrc.1.auto: <== DevCtl=19, int_usb=0x20
    [ 145.533432] musb-hdrc musb-hdrc.1.auto: DISCONNECT (a_host) as Host, devctl 19
    [ 147.277006] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0010 tx0000 rx0000
    [ 147.284283] musb-hdrc musb-hdrc.1.auto: <== DevCtl=5d, int_usb=0x10
    [ 147.291009] musb-hdrc musb-hdrc.1.auto: CONNECT (a_host) devctl 5d
    [ 148.962386] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0020 tx0000 rx0000
    [ 148.969701] musb-hdrc musb-hdrc.1.auto: <== DevCtl=19, int_usb=0x20
    [ 148.976415] musb-hdrc musb-hdrc.1.auto: DISCONNECT (a_host) as Host, devctl 19
    [ 150.987792] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0010 tx0000 rx0000
    [ 150.995076] musb-hdrc musb-hdrc.1.auto: <== DevCtl=5d, int_usb=0x10
    [ 151.001807] musb-hdrc musb-hdrc.1.auto: CONNECT (a_host) devctl 5d
    [ 155.238417] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0020 tx0000 rx0000
    [ 155.245659] musb-hdrc musb-hdrc.1.auto: <== DevCtl=19, int_usb=0x20
    [ 155.252366] musb-hdrc musb-hdrc.1.auto: DISCONNECT (a_host) as Host, devctl 19
    [ 157.380795] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0010 tx0000 rx0000
    [ 157.388051] musb-hdrc musb-hdrc.1.auto: <== DevCtl=5d, int_usb=0x10
    [ 157.394740] musb-hdrc musb-hdrc.1.auto: CONNECT (a_host) devctl 5d
    [ 158.860133] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0020 tx0000 rx0000
    [ 158.867366] musb-hdrc musb-hdrc.1.auto: <== DevCtl=19, int_usb=0x20
    [ 158.874066] musb-hdrc musb-hdrc.1.auto: DISCONNECT (a_host) as Host, devctl 19
    [ 161.384074] musb-hdrc musb-hdrc.1.auto: ** IRQ host usb0010 tx0000 rx0000
    [ 161.391308] musb-hdrc musb-hdrc.1.auto: <== DevCtl=5d, int_usb=0x10
    [ 161.398036] musb-hdrc musb-hdrc.1.auto: CONNECT (a_host) devctl 5d


    Thanks,
    Harsha
  • Harsha,

    I am bit of confused with your description of the latest issue after kernel patching - crash...no crash..., and the kernel debug log does not help much, which only basically shows some EP0 activity then only connect/disconnect events.

    Anyway, the TI 3.14 kernel will be released soon coming with SDK8.0. Following is the kernel info, can you please try if the new kernel fixes your issues?

    git://git.ti.com/ti-linux-kernel/ti-linux-kernel.git

    tag: ti2014.10.01.

    Please note that by default omap2plus_defconfig in 3.14 does not have CONFIG_USB_MUSB_HDRC enabled. Please manually enable it to module in menuconfig.