Bug 199669 - WARNING: possible recursive locking, bt_accept_enqueue l2cap_sock_new_connection_cb
Summary: WARNING: possible recursive locking, bt_accept_enqueue l2cap_sock_new_connect...
Status: NEW
Alias: None
Product: Drivers
Classification: Unclassified
Component: Bluetooth (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: linux-bluetooth@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-05-09 21:01 UTC by Chris Murphy
Modified: 2018-05-09 21:02 UTC (History)
0 users

See Also:
Kernel Version: 4.17.0-0.rc4.git1.1.fc29.x86_64
Subsystem:
Regression: No
Bisected commit-id:


Attachments
dmesg (110.98 KB, text/plain)
2018-05-09 21:02 UTC, Chris Murphy
Details
full journal for this boot (352.22 KB, text/plain)
2018-05-09 21:02 UTC, Chris Murphy
Details

Description Chris Murphy 2018-05-09 21:01:45 UTC
Shortly after startup, I get a recursive lock warning in Fedora debug kernels.

This is in the journal just before the warning and call trace:

[   38.069308] f28h.local bluetoothd[737]: src/adapter.c:connected_callback() hci0 device 58:1F:AA:EB:B4:6A connected eir_len 13

And then the warning:

[   38.452951] ============================================
[   38.452953] WARNING: possible recursive locking detected
[   38.452957] 4.17.0-0.rc4.git1.1.fc29.x86_64 #1 Not tainted
[   38.452959] --------------------------------------------
[   38.452962] kworker/u9:3/679 is trying to acquire lock:
[   38.452964] 00000000bc5df450 (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: bt_accept_enqueue+0x3c/0xb0 [bluetooth]
[   38.452988] 
               but task is already holding lock:
[   38.452991] 000000008b816fd8 (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: l2cap_sock_new_connection_cb+0x18/0xa0 [bluetooth]
[   38.453015] 
               other info that might help us debug this:
[   38.453018]  Possible unsafe locking scenario:

[   38.453021]        CPU0
[   38.453023]        ----
[   38.453024]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);
[   38.453028]   lock(sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP);
[   38.453031] 
                *** DEADLOCK ***

[   38.453034]  May be due to missing lock nesting notation

[   38.453038] 5 locks held by kworker/u9:3/679:
[   38.453040]  #0: 00000000cb657509 ((wq_completion)"%s"hdev->name#2){+.+.}, at: process_one_work+0x1d7/0x630
[   38.453051]  #1: 00000000c5923079 ((work_completion)(&hdev->rx_work)){+.+.}, at: process_one_work+0x1d7/0x630
[   38.453058]  #2: 00000000764e3538 (&conn->chan_lock){+.+.}, at: l2cap_connect+0x8f/0x5a0 [bluetooth]
[   38.453084]  #3: 000000001231acea (&chan->lock/2){+.+.}, at: l2cap_connect+0xa9/0x5a0 [bluetooth]
[   38.453110]  #4: 000000008b816fd8 (sk_lock-AF_BLUETOOTH-BTPROTO_L2CAP){+.+.}, at: l2cap_sock_new_connection_cb+0x18/0xa0 [bluetooth]
[   38.453134] 
               stack backtrace:
[   38.453140] CPU: 2 PID: 679 Comm: kworker/u9:3 Not tainted 4.17.0-0.rc4.git1.1.fc29.x86_64 #1
[   38.453143] Hardware name: HP HP Spectre Notebook/81A0, BIOS F.40 02/26/2018
[   38.453166] Workqueue: hci0 hci_rx_work [bluetooth]
[   38.453170] Call Trace:
[   38.453178]  dump_stack+0x85/0xc0
[   38.453183]  __lock_acquire.cold.64+0x158/0x227
[   38.453189]  ? mark_held_locks+0x57/0x80
[   38.453195]  ? lock_acquire+0x9e/0x1b0
[   38.453213]  ? bt_accept_enqueue+0x3c/0xb0 [bluetooth]
[   38.453218]  ? lock_sock_nested+0x72/0xa0
[   38.453235]  ? bt_accept_enqueue+0x3c/0xb0 [bluetooth]
[   38.453253]  ? bt_accept_enqueue+0x3c/0xb0 [bluetooth]
[   38.453275]  ? l2cap_sock_new_connection_cb+0x5d/0xa0 [bluetooth]
[   38.453298]  ? l2cap_connect+0x110/0x5a0 [bluetooth]
[   38.453320]  ? l2cap_recv_frame+0x6d0/0x2cb0 [bluetooth]
[   38.453326]  ? __mutex_unlock_slowpath+0x4b/0x2b0
[   38.453349]  ? l2cap_recv_frame+0x6e8/0x2cb0 [bluetooth]
[   38.453354]  ? __mutex_unlock_slowpath+0x4b/0x2b0
[   38.453372]  ? hci_rx_work+0x1c6/0x5d0 [bluetooth]
[   38.453378]  ? process_one_work+0x261/0x630
[   38.453385]  ? worker_thread+0x3a/0x390
[   38.453390]  ? process_one_work+0x630/0x630
[   38.453394]  ? kthread+0x120/0x140
[   38.453398]  ? kthread_create_worker_on_cpu+0x70/0x70
[   38.453403]  ? ret_from_fork+0x3a/0x50


[chris@f28h ~]$ sudo hciconfig -a
hci0:	Type: Primary  Bus: USB
	BD Address: 00:C2:C6:F0:52:57  ACL MTU: 1021:4  SCO MTU: 96:6
	UP RUNNING PSCAN ISCAN 
	RX bytes:400385 acl:19244 sco:0 events:154 errors:0
	TX bytes:4497 acl:28 sco:0 commands:103 errors:0
	Features: 0xbf 0xfe 0x0f 0xfe 0xdb 0xff 0x7b 0x87
	Packet type: DM1 DM3 DM5 DH1 DH3 DH5 HV1 HV2 HV3 
	Link policy: RSWITCH SNIFF 
	Link mode: SLAVE ACCEPT 
	Name: 'f28h.local'
	Class: 0x4c010c
	Service Classes: Rendering, Capturing, Telephony
	Device Class: Computer, Laptop
	HCI Version: 4.2 (0x8)  Revision: 0x100
	LMP Version: 4.2 (0x8)  Subversion: 0x100
	Manufacturer: Intel Corp. (2)

 

Possible downstream bug shows this happening with kernel 4.6.1
https://bugzilla.redhat.com/show_bug.cgi?id=1566104
Comment 1 Chris Murphy 2018-05-09 21:02:34 UTC
Created attachment 275887 [details]
dmesg
Comment 2 Chris Murphy 2018-05-09 21:02:52 UTC
Created attachment 275889 [details]
full journal for this boot

Note You need to log in before you can comment on or make changes to this bug.