hciattach crash on imx6ul

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

hciattach crash on imx6ul

625 Views
mihaitaivascu
Contributor III

Hello,

      I am trying to do a hciattach /dev/ttyACM0 on my imxul platform but I get kernel crash all the time.

      I have tried 4.8 and 4.12 kernel versions. The issue is the same.

      It seems that at the end always a _raw_spin_unlock_irqrestore is the function call that generates the exception. 

[ 365.027777] CPU: 0 PID: 867 Comm: hciattach Not tainted 4.12.4 #10
[ 365.033989] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 365.040197] Backtrace:
[ 365.042704] [<c010c5c4>] (dump_backtrace) from [<c010c86c>] (show_stack+0x18/0x1c)
[ 365.050314] r7:dab8c000 r6:600d0193 r5:00000000 r4:c0e279dc
[ 365.056017] [<c010c854>] (show_stack) from [<c040bc44>] (dump_stack+0xb4/0xe8)
[ 365.063286] [<c040bb90>] (dump_stack) from [<c040ecfc>] (nmi_cpu_backtrace+0xac/0xbc)
[ 365.071160] r10:800d0193 r9:c0e079b0 r8:c0a02240 r7:00000000 r6:00000000 r5:00000000
[ 365.079022] r4:00000000 r3:c0e199b0
[ 365.082639] [<c040ec50>] (nmi_cpu_backtrace) from [<c040eddc>] (nmi_trigger_cpumask_backtrace+0xd0/0x120)
[ 365.092239] r5:c0e07bf8 r4:c010f340
[ 365.095858] [<c040ed0c>] (nmi_trigger_cpumask_backtrace) from [<c010fef4>] (arch_trigger_cpumask_backtrace+0x14/0x1c)
[ 365.106507] r9:c0e079b0 r8:00000240 r7:c0a0223c r6:c0e19fc0 r5:00000000 r4:c0e19fc0
[ 365.114299] [<c010fee0>] (arch_trigger_cpumask_backtrace) from [<c01d1774>] (rcu_dump_cpu_stacks+0xa0/0xdc)
[ 365.124089] [<c01d16d4>] (rcu_dump_cpu_stacks) from [<c018ae10>] (rcu_check_callbacks+0x688/0x844)
[ 365.133090] r10:c0e079a8 r9:c0e079f4 r8:00000001 r7:1f23d000 r6:c0d7a980 r5:dffb7980
[ 365.140952] r4:c0e19fc0 r3:00000000
[ 365.144571] [<c018a788>] (rcu_check_callbacks) from [<c018f254>] (update_process_times+0x38/0x64)
[ 365.153486] r10:c01a2480 r9:dffb468c r8:dffb4680 r7:00000054 r6:f5bc5321 r5:00000000
[ 365.161346] r4:dab0b100
[ 365.163925] [<c018f21c>] (update_process_times) from [<c01a1e10>] (tick_sched_handle+0x50/0x54)
[ 365.172657] r5:dab8d868 r4:dffb4960
[ 365.176276] [<c01a1dc0>] (tick_sched_handle) from [<c01a24d8>] (tick_sched_timer+0x58/0xa4)
[ 365.184671] [<c01a2480>] (tick_sched_timer) from [<c01901e8>] (__hrtimer_run_queues+0xc0/0x1e4)
[ 365.193406] r7:00000000 r6:c0e27acc r5:dffb4960 r4:dffb4600
[ 365.199108] [<c0190128>] (__hrtimer_run_queues) from [<c01905b0>] (hrtimer_interrupt+0xbc/0x214)
[ 365.207936] r10:dffb46b8 r9:dffb46d8 r8:dffb46f8 r7:dffb4640 r6:ffffffff r5:00000003
[ 365.215795] r4:dffb4600
[ 365.218372] [<c01904f4>] (hrtimer_interrupt) from [<c0707e64>] (mxc_timer_interrupt+0x3c/0x44)
[ 365.227026] r10:c0e1ca72 r9:db409400 r8:00000010 r7:dab8d79c r6:00000000 r5:db409400
[ 365.234886] r4:db409240
[ 365.237464] [<c0707e28>] (mxc_timer_interrupt) from [<c017a550>] (__handle_irq_event_percpu+0x8c/0x124)
[ 365.246893] r5:db409400 r4:db409300
[ 365.250513] [<c017a4c4>] (__handle_irq_event_percpu) from [<c017a60c>] (handle_irq_event_percpu+0x24/0x60)
[ 365.260209] r10:00000000 r9:db404400 r8:00000001 r7:dab8d9f8 r6:c0e13f4c r5:db409400
[ 365.268069] r4:db409400
[ 365.270644] [<c017a5e8>] (handle_irq_event_percpu) from [<c017a688>] (handle_irq_event+0x40/0x64)
[ 365.279550] r5:db409460 r4:db409400
[ 365.283170] [<c017a648>] (handle_irq_event) from [<c017dda4>] (handle_fasteoi_irq+0xd4/0x1ac)
[ 365.291735] r7:dab8d9f8 r6:c0e13f4c r5:db409460 r4:db409400
[ 365.297439] [<c017dcd0>] (handle_fasteoi_irq) from [<c0179748>] (generic_handle_irq+0x28/0x3c)
[ 365.306088] r7:dab8d9f8 r6:c0e07ac4 r5:00000010 r4:c0d7830c
[ 365.311790] [<c0179720>] (generic_handle_irq) from [<c0179d08>] (__handle_domain_irq+0x6c/0xe8)
[ 365.320531] [<c0179c9c>] (__handle_domain_irq) from [<c01015f8>] (gic_handle_irq+0x58/0xb8)
[ 365.328924] r9:c0e07c28 r8:e080a000 r7:c0e27d80 r6:dab8d868 r5:000003eb r4:e080a00c

[ 365.336707] [<c01015a0>] (gic_handle_irq) from [<c010d4b0>] (__irq_svc+0x70/0x98)

[ 365.479042] Exception stack(0xdab8d9f8 to 0xdab8da40)
[ 365.484128] d9e0: 00000001 00000110
[ 365.492346] da00: 00000000 dab0b100 600d0013 daefcc88 014000c0 daefcc88 dab8db60 dab8dab4
[ 365.500563] da20: daab0400 dab8da5c dab8d9f0 dab8da48 c016ce48 c09746a4 200d0013 ffffffff
[ 365.508781] r10:daab0400 r9:dab8c000 r8:dab8db60 r7:dab8da2c r6:ffffffff r5:200d0013
[ 365.516641] r4:c09746a4
[ 365.519223] [<c0974668>] (_raw_spin_unlock_irqrestore) from [<c0218c2c>] (dma_pool_alloc+0x190/0x22c)
[ 365.528475] r5:daefcc80 r4:dbc7b7e0
[ 365.532098] [<c0218a9c>] (dma_pool_alloc) from [<c0648a34>] (ehci_qtd_alloc+0x1c/0x60)
[ 365.540060] r10:daab0400 r9:dadf39d0 r8:dab8db60 r7:dadf3800 r6:dab7a780 r5:dadf3800
[ 365.547919] r4:dab7a780
[ 365.550497] [<c0648a18>] (ehci_qtd_alloc) from [<c0648bc4>] (qh_urb_transaction+0x2c/0x474)
[ 365.558881] r5:dadf3800 r4:dab7a780
[ 365.562504] [<c0648b98>] (qh_urb_transaction) from [<c064d6d8>] (ehci_urb_enqueue+0x74/0xfa0)
[ 365.571071] r10:daab0400 r9:00000003 r8:014000c0 r7:dadf3800 r6:dab7a780 r5:dadf3800
[ 365.578930] r4:dab8db60
[ 365.581507] [<c064d664>] (ehci_urb_enqueue) from [<c0632858>] (usb_hcd_submit_urb+0xb4/0x85c)
[ 365.590074] r10:daab0400 r9:00000003 r8:014000c0 r7:dab7a788 r6:00000000 r5:dadf3800
[ 365.597933] r4:dab7a780
[ 365.600510] [<c06327a4>] (usb_hcd_submit_urb) from [<c0633f18>] (usb_submit_urb+0x2b0/0x50c)
[ 365.608991] r10:daab0400 r9:00000003 r8:00000204 r7:00000002 r6:dafb4c00 r5:014000c0
[ 365.616852] r4:dab7a780
[ 365.619450] [<c0633c68>] (usb_submit_urb) from [<bf0002c0>] (acm_submit_read_urb+0x48/0x90 [cdc_acm])
[ 365.628715] r10:daab0400 r9:c164ed10 r8:da944800 r7:da944b74 r6:da944800 r5:0000000b
[ 365.636577] r4:014000c0
[ 365.639173] [<bf000278>] (acm_submit_read_urb [cdc_acm]) from [<bf002694>] (acm_port_activate+0x138/0x1a0 [cdc_acm])
[ 365.649735] r7:da944d50 r6:0000000b r5:00000000 r4:da944814
[ 365.655451] [<bf00255c>] (acm_port_activate [cdc_acm]) from [<c04bade0>] (tty_port_open+0x88/0xc8)
[ 365.664453] r9:c164ed10 r8:daaffbe8 r7:c3c1cdc0 r6:da94493c r5:daab0400 r4:da944814
[ 365.672252] [<c04bad58>] (tty_port_open) from [<bf001498>] (acm_tty_open+0x20/0x24 [cdc_acm])
[ 365.680820] r9:c164ed10 r8:daaffbe8 r7:c0a3f000 r6:0a600000 r5:c3c1cdc0 r4:daab0400
[ 365.688616] [<bf001478>] (acm_tty_open [cdc_acm]) from [<c04b39a4>] (tty_open+0xc4/0x490)
[ 365.696838] [<c04b38e0>] (tty_open) from [<c0228868>] (chrdev_open+0xa4/0x180)
[ 365.704103] r10:dab8dea8 r9:db001508 r8:00000000 r7:c0a3f078 r6:c3c1cdc0 r5:daaffbe8
[ 365.711963] r4:dab84640
[ 365.714538] [<c02287c4>] (chrdev_open) from [<c0220490>] (do_dentry_open+0x1f0/0x318)
[ 365.722406] r7:c02287c4 r6:c3c1cdc8 r5:daaffbe8 r4:c3c1cdc0
[ 365.728110] [<c02202a0>] (do_dentry_open) from [<c02216bc>] (vfs_open+0x54/0x84)
[ 365.735547] r9:db001508 r8:00000000 r7:00000102 r6:00000000 r5:c3c1cdc0 r4:dab8dea8
[ 365.743334] [<c0221668>] (vfs_open) from [<c0232d44>] (path_openat+0x32c/0xfb8)
[ 365.750681] r6:00000000 r5:dab8df5c r4:00000000
[ 365.755347] [<c0232a18>] (path_openat) from [<c0234d20>] (do_filp_open+0x68/0xcc)
[ 365.762870] r10:00000000 r9:dab8c000 r8:c0107fc4 r7:00000001 r6:dab8df5c r5:dab8dea8
[ 365.770730] r4:00000003
[ 365.773310] [<c0234cb8>] (do_filp_open) from [<c0221a68>] (do_sys_open+0x108/0x1d0)
[ 365.781004] r7:00000005 r6:da824000 r5:ffffff9c r4:00000003
[ 365.786707] [<c0221960>] (do_sys_open) from [<c0221b50>] (SyS_open+0x20/0x24)
[ 365.793884] r9:dab8c000 r8:c0107fc4 r7:00000005 r6:bec64d84 r5:bec63c08 r4:00037390
[ 365.801671] [<c0221b30>] (SyS_open) from [<c0107e20>] (ret_fast_syscall+0x0/0x1c)

I have also attached the BT kernel configuration.

Could somebody give me some hint about possible issue or what I shoulf investigate next?

I did debugged the usb stack but could not find where the problem is exactly.

 I have also increased vmalloc parameter in kernel bootargs as in some times the crash is preceded by a dma_pool_malloc but that was not successful.

Thanks,

       Mihaita

Labels (1)
0 Kudos
4 Replies

502 Views
igorpadykov
NXP Employee
NXP Employee

Hi Mihaita

4.8 and 4.12 kernel versions are not supported by nxp, that may be posted on kernel mail list.

One can try with kernel versions described on nxp software page

i.MX Software|NXP 

for example L4.9.88 and test with USB Gadget serial test

mxc_usb_test\test - imx-test - i.MX Driver Test Application Software 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

502 Views
mihaitaivascu
Contributor III

Hi Igor,

    Thanks for the reply. I have tried with 

kernel/git/stable/linux.git - Linux kernel stable tree 

 version 4.6 and it still crashes. It seems that whatever kernel i try I still have these issues

 I don't think is hardware maybe the device tree configuration. What should I look after?

Thanks,

      Mihaita

0 Kudos

502 Views
mihaitaivascu
Contributor III

Could be something related to usb wake up irq callback and using dma_pool_alloc ?

Thanks,

      Mihaita

0 Kudos

502 Views
mihaitaivascu
Contributor III

I see that after I get in intr_submit() function call 

if (unlikely(!HCD_HW_ACCESSIBLE(ehci_to_hcd(ehci)))) {           status = -ESHUTDOWN;           goto done_not_linked;      }

afterwards in the routine:

done_not_linked:      spin_unlock_irqrestore (&ehci->lock, flags);

the spin_unlock_restore will cause the crash


0 Kudos