OpenNuvoton / NUC970_Linux_Kernel

Linux Kernel Source Code for NUC970 Series Microprocessor
Other
68 stars 69 forks source link

Kernel panic when connecting a bluetooth device #51

Closed kormilicinkostia closed 2 years ago

kormilicinkostia commented 4 years ago

Good day. I use nuc977DK62Y with the rtl8723bu chip. I am trying to connect from my device via bt to another device. In order to subscribe, I do the following:

hciconfig hci0 up
hcitool scan
rfcomm connect rfcomm0 00:19:86:00:29:7D &

When I try to connect, I see Linux kernel panic (I use the commit 648b254ac8b66164163cd0da44e20ddeb32db79d):

[  151.590000] rtk_btusb: hci0 evt 2
[  151.590000] rtk_btusb: btusb_notify : hci0 evt 2
[  151.590000] rtk_btusb: notify wifi start page
[  152.770000] rtk_btusb: notify wifi page success end
[  152.830000] rtk_btusb: L2CAP_CONNECTION_REQ, handle=2, PSM=3, scid=40
[  152.880000] rtk_btusb: L2CAP_CONNECTION_RESP, handle=2, dcid=0, scid=40, result=1
[  152.880000] rtk_btusb: L2CAP_CONNECTION_RESP, handle=2, dcid=40, scid=40, result=0
[  152.880000] rtk_btusb: l2cap connection success, update connection
[  152.880000] rtk_btusb: update_profile_connection: is_add=1, profile_index=3
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_bitmap = 8
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[0] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[1] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[2] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[3] = 1
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[4] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[5] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[6] = 0
[  152.880000] rtk_btusb: update_profile_connection: usb_coex_info.profile_refcount[7] = 0
[  152.880000] rtk_btusb: rtk_notify_profileinfo_to_fw, BufferSize is 5
[  152.880000] rtk_btusb: rtk_notify_profileinfo_to_fw, NumberOfHandles is 1
[  152.880000] rtk_btusb: rtk_notify_profileinfo_to_fw, handle is 2
[  152.880000] rtk_btusb: rtk_notify_profileinfo_to_fw, profile_bitmap is 8
[  152.880000] rtk_btusb: rtk_notify_profileinfo_to_fw, profile_status is 0
[  152.880000] rtk_btusb: rtk_vendor_cmd_to_fw, opcode is 0xfc19
[  153.020000] rtk_btusb: in hci_cmd_task, coex_info.num_hci_cmd_packet is 1
[  153.030000] rtk_btusb: send cmd to fw, opcode = 0xfc19
[  153.150000] Unable to handle kernel paging request at virtual address ffffffe0
[  153.160000] pgd = c0004000
[  153.160000] [ffffffe0] *pgd=03ffd831, *pte=00000000[  153.170000] Unable to handle kernel paging request at virtual address ffffffe0
[  153.170000] pgd = c3008000

[  153.190000] [ffffffe0] *pgd=03ffd831, *pte=00000000, *ppte=00000000
[  153.190000] Internal error: Oops: 17 [#1] PREEMPT ARM
[  153.190000] Modules linked in:
[  153.190000] CPU: 0 PID: 1071 Comm: klogd Not tainted 3.10.108+ #3
[  153.190000] task: c3865900 ti: c3be8000 task.ti: c3be8000
[  153.190000] PC is at __kmalloc_track_caller+0xa4/0x138
[  153.190000] LR is at __kmalloc_track_caller+0x6c/0x138
[  153.190000] pc : [<c00b0984>]    lr : [<c00b094c>]    psr: a0000013
[  153.190000] sp : c3be9cd0  ip : c3be9cd0  fp : c3be9cf4
[  153.190000] r10: 00000064  r9 : c3be8000  r8 : c030b458
[  153.190000] r7 : 000010da  r6 : 000106d0  r5 : c3801c80  r4 : ffffffe0
[  153.190000] r3 : 00000000  r2 : 00000001  r1 : 00000001  r0 : 00000000
[  153.190000] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
[  153.190000] Control: 0005317f  Table: 03008000  DAC: 00000015
[  153.190000] Process klogd (pid: 1071, stack limit = 0xc3be81b8)
[  153.190000] Stack: (0xc3be9cd0 to 0xc3bea000)
[  153.190000] 9cc0:                                     c3ab0d80 00000100 000004d0 c3801d00
[  153.190000] 9ce0: 00000000 c030b458 c3be9d24 c3be9cf8 c0310ed4 c00b08f0 ffffffff c3bce1c0
[  153.190000] 9d00: 000004d0 00000000 00000000 00000000 c3be9d40 00000064 c3be9d74 c3be9d28
[  153.190000] 9d20: c030b458 c0310e6c c00426e0 00000039 000000c3 c03136f0 c3be9d5c c3bce000
[  153.190000] 9d40: 00000001 c3ab0d80 00000100 c3bce000 c3bce1c0 00000000 00000039 c3be9ecc
[  153.190000] 9d60: 00000000 c3be9df8 c3be9df4 c3be9d78 c0379470 c030b3bc c3be9dac c34aadd8
[  153.190000] 9d80: c3be9dd4 c0579db8 c3be9da4 c3be9d98 00000000 c3403dc0 00000039 00000000
[  153.190000] 9da0: 0000001d c3bf7aa8 c3be9dd4 ffffffa6 c00cec04 00000000 00000000 00000000
[  153.190000] 9dc0: ffffffff ffffffff c05c3d60 c3403dc0 00000039 c3be9ecc c3865900 bed21898
[  153.190000] 9de0: 00000000 00000000 c3be9eb4 c3be9df8 c0307b24 c0379300 c3bf7aa0 000005b4
[  153.190000] 9e00: 00000000 00000039 c3403dc0 00000044 c3be9db4 c3be9ecc c007e1ec c00ca7b8
[  153.190000] 9e20: c0562518 c3bf7e60 00000024 c34aff68 00000000 00000000 00000001 00000000
[  153.190000] 9e40: 00000000 00000000 00000000 c3865900 00000000 00000000 00000000 00000000
[  153.190000] 9e60: c3be9df8 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  153.190000] 9e80: 00000000 00000000 00000000 00000000 00000000 00000000 00004000 00000039
[  153.190000] 9ea0: c3403dc0 00000000 c3be9f8c c3be9eb8 c03098a4 c0307ab4 c00b3e80 fffffff7
[  153.190000] 9ec0: 00000000 bed21898 00000039 00000000 00000000 c3be9ec4 00000001 00000000
[  153.190000] 9ee0: 00000000 00004000 c3bf7e60 c0562688 c0562518 c3bf7aa0 c3be9f2c c3be9f08
[  153.190000] 9f00: c3be9f2c c3be9f10 c00cec04 c0041f24 c3bf7aa0 c34aadd0 c38b63d0 c34b0180
[  153.190000] 9f20: c3be9f3c c3be9f30 c00ced18 c00cebdc c3be9f5c c3be9f40 c00b53b8 c00cecfc
[  153.190000] 9f40: c3865900 00000000 c05a2564 00000006 c3be9f6c c3be9f60 c00b540c c00b5220
[  153.190000] 9f60: c3be9f8c c3be9f70 bed218d0 00000000 bed218d1 00000121 c000e3e8 c3be8000
[  153.190000] 9f80: c3be9fa4 c3be9f90 c03098e8 c03097f0 00000000 00000000 00000000 c3be9fa8
[  153.190000] 9fa0: c000e240 c03098d8 bed218d0 00000000 00000003 bed21898 00000039 00004000
[  153.190000] 9fc0: bed218d0 00000000 bed218d1 00000121 bed21898 b6fc7030 bed21888 b6fc7030
[  153.190000] 9fe0: 000003e4 bed21860 b6f825d8 b6fab3d0 60000010 00000003 00000000 00000000
[  153.190000] Backtrace:
[  153.190000] [<c00b08e0>] (__kmalloc_track_caller+0x0/0x138) from [<c0310ed4>] (__alloc_skb+0x78/0x174)
[  153.190000]  r9:c030b458 r8:00000000 r7:c3801d00 r6:000004d0 r5:00000100
r4:c3ab0d80
[  153.190000] [<c0310e5c>] (__alloc_skb+0x0/0x174) from [<c030b458>] (sock_alloc_send_pskb+0xac/0x340)
[  153.190000] [<c030b3ac>] (sock_alloc_send_pskb+0x0/0x340) from [<c0379470>] (unix_dgram_sendmsg+0x180/0x664)
[  153.190000] [<c03792f0>] (unix_dgram_sendmsg+0x0/0x664) from [<c0307b24>] (sock_sendmsg+0x80/0x9c)
[  153.190000] [<c0307aa4>] (sock_sendmsg+0x0/0x9c) from [<c03098a4>] (SyS_sendto+0xc4/0xe8)
[  153.190000]  r7:00000000 r6:c3403dc0 r5:00000039 r4:00004000
[  153.190000] [<c03097e0>] (SyS_sendto+0x0/0xe8) from [<c03098e8>] (SyS_send+0x20/0x28)
[  153.190000]  r9:c3be8000 r8:c000e3e8 r7:00000121 r6:bed218d1 r5:00000000
r4:bed218d0
[  153.190000] [<c03098c8>] (SyS_send+0x0/0x28) from [<c000e240>] (ret_fast_syscall+0x0/0x34)
[  153.190000] Code: ebfff6c4 e1a04000 ea000017 e5953014 (e7942003)
[  153.580000] ---[ end trace bc1d8fbff08e3bad ]---
[  153.580000] , *ppte=00000000
[  153.600000] Internal error: Oops: 17 [#2] PREEMPT ARM
[  153.600000] Modules linked in:
[  153.600000] CPU: 0 PID: 1217 Comm: kworker/u2:1 Tainted: G      D      3.10.108+ #3
[  153.600000] task: c38a55e0 ti: c306e000 task.ti: c306e000
[  153.600000] PC is at kmem_cache_alloc+0x74/0x104
[  153.600000] LR is at kmem_cache_alloc+0x3c/0x104
[  153.600000] pc : [<c00aeb34>]    lr : [<c00aeafc>]    psr: a0000013
[  153.600000] sp : c306ff10  ip : c306ff10  fp : c306ff34
[  153.600000] r10: 00000000  r9 : c306e000  r8 : c00ba424
[  153.600000] r7 : 000010da  r6 : 000080d0  r5 : c3801c80  r4 : ffffffe0
[  153.600000] r3 : 00000000  r2 : 00000001  r1 : 00000000  r0 : 00000000
[  153.600000] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[  153.600000] Control: 0005317f  Table: 030cc000  DAC: 00000017
[  153.600000] Process kworker/u2:1 (pid: 1217, stack limit = 0xc306e1b8)
[  153.600000] Stack: (0xc306ff10 to 0xc3070000)
[  153.600000] ff00:                                     c307f480 00000000 c306e038 c05690cc
[  153.600000] ff20: 00000000 c306e000 c306ff7c c306ff38 c00ba424 c00aead0 c003f97c c006ed7c
[  153.600000] ff40: c3b47000 c305fc64 00000000 c003f930 ffffffff c307f480 c30c8e40 c306e000
[  153.600000] ff60: 00000000 00000000 00000000 00000000 c306ff9c c306ff80 c0030da0 c00ba3a8
[  153.600000] ff80: c05a2414 c30c8e40 c0030dc4 00000000 c306ffac c306ffa0 c0030dec c0030c84
[  153.600000] ffa0: 00000000 c306ffb0 c000e2d8 c0030dd4 00000000 00000000 00000000 00000000
[  153.600000] ffc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[  153.600000] ffe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[  153.600000] Backtrace:
[  153.600000] [<c00aeac0>] (kmem_cache_alloc+0x0/0x104) from [<c00ba424>] (do_execve+0x8c/0x490)
[  153.600000]  r9:c306e000 r8:00000000 r7:c05690cc r6:c306e038 r5:00000000
r4:c307f480
[  153.600000] [<c00ba398>] (do_execve+0x0/0x490) from [<c0030da0>] (____call_usermodehelper+0x12c/0x150)
[  153.600000] [<c0030c74>] (____call_usermodehelper+0x0/0x150) from [<c0030dec>] (call_helper+0x28/0x30)
[  153.600000]  r6:00000000 r5:c0030dc4 r4:c30c8e40 r3:c05a2414
[  153.600000] [<c0030dc4>] (call_helper+0x0/0x30) from [<c000e2d8>] (ret_from_fork+0x14/0x3c)
[  153.600000] Code: ebfffe58 e1a04000 ea000017 e5953014 (e7942003)
[  153.820000] ---[ end trace bc1d8fbff08e3bae ]---
Connected /dev/rfcomm0 to 00:19:86:00:29:7D on channel 1`

Using gdb, I found out that an error occurs in the /mm/slub.c file in the get_freepointer function, presumably due to an invalid pointer to the kmem_cache structure In order to connect the bt device, I assembled the driver provided by the vendor (if necessary, I can transfer it to you). I checked that it wasn’t the driver because I built this driver for my raspberry pi and it works successfully there. Can you help me solve this problem?

kormilicinkostia commented 4 years ago

@yachen

yachen commented 4 years ago

Hi, I'm afraid I don't have the environment to check this issue. We're not seeing such panic using RTL WiFi dongles which we have.