R10: 0000000000000000 R11: 0000000000000213 R12: 000000002000bdc0 R13: 000000002000be00 R14: 00007f4139095000 R15: 000000002000bfc0 ====================================================== WARNING: possible circular locking dependency detected 6.2.0-rc7-next-20230213 #1 Not tainted ------------------------------------------------------ kworker/0:2/58 is trying to acquire lock: ffff888043a87130 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: sco_sock_timeout+0xc7/0x230 but task is already holding lock: ffff88800f8cfdb0 ((work_completion)(&(&conn->timeout_work)->work)){+.+.}-{0:0}, at: process_one_work+0x941/0x1790 which lock already depends on the new lock. the existing dependency chain (in reverse order) is: -> #3 ((work_completion)(&(&conn->timeout_work)->work)){+.+.}-{0:0}: __flush_work+0x109/0xd80 __cancel_work_timer+0x39c/0x4e0 sco_conn_del+0x1e4/0x2c0 sco_disconn_cfm+0x66/0x80 hci_conn_hash_flush+0x11d/0x230 hci_dev_close_sync+0x57f/0xff0 hci_unregister_dev+0x15e/0x410 vhci_release+0x80/0x100 __fput+0x263/0xa40 task_work_run+0x174/0x280 do_exit+0xad8/0x2800 do_group_exit+0xd4/0x2a0 __x64_sys_exit_group+0x3e/0x50 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #2 (hci_cb_list_lock){+.+.}-{3:3}: __mutex_lock+0x133/0x14a0 hci_remote_features_evt+0x45a/0x950 hci_event_packet+0x91d/0xf60 hci_rx_work+0xa86/0x1110 process_one_work+0xa0f/0x1790 worker_thread+0x63b/0x1260 kthread+0x2e9/0x3a0 ret_from_fork+0x2c/0x50 -> #1 (&hdev->lock){+.+.}-{3:3}: __mutex_lock+0x133/0x14a0 sco_sock_connect+0x1e8/0xa60 __sys_connect_file+0x159/0x1a0 __sys_connect+0x169/0x1a0 __x64_sys_connect+0x73/0xb0 do_syscall_64+0x3f/0x90 entry_SYSCALL_64_after_hwframe+0x72/0xdc -> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: __lock_acquire+0x2da7/0x63b0 lock_acquire.part.0+0xec/0x320 lock_sock_nested+0x41/0xf0 sco_sock_timeout+0xc7/0x230 process_one_work+0xa0f/0x1790 worker_thread+0x63b/0x1260 kthread+0x2e9/0x3a0 ret_from_fork+0x2c/0x50 other info that might help us debug this: Chain exists of: sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> hci_cb_list_lock --> (work_completion)(&(&conn->timeout_work)->work) Possible unsafe locking scenario: CPU0 CPU1 ---- ---- lock((work_completion)(&(&conn->timeout_work)->work)); lock(hci_cb_list_lock); lock((work_completion)(&(&conn->timeout_work)->work)); lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); *** DEADLOCK *** 2 locks held by kworker/0:2/58: #0: ffff888008468d38 ((wq_completion)events){+.+.}-{0:0}, at: process_one_work+0x90d/0x1790 #1: ffff88800f8cfdb0 ((work_completion)(&(&conn->timeout_work)->work)){+.+.}-{0:0}, at: process_one_work+0x941/0x1790 stack backtrace: CPU: 0 PID: 58 Comm: kworker/0:2 Not tainted 6.2.0-rc7-next-20230213 #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014 Workqueue: events sco_sock_timeout Call Trace: dump_stack_lvl+0x91/0xf0 check_noncircular+0x263/0x2e0 __lock_acquire+0x2da7/0x63b0 lock_acquire.part.0+0xec/0x320 lock_sock_nested+0x41/0xf0 sco_sock_timeout+0xc7/0x230 process_one_work+0xa0f/0x1790 worker_thread+0x63b/0x1260 kthread+0x2e9/0x3a0 ret_from_fork+0x2c/0x50