Bluetooth: hci_event: Fix Invalid wait context
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 11 Jan 2023 01:04:46 +0000 (17:04 -0800)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 17 Jan 2023 23:59:02 +0000 (15:59 -0800)
commite9d50f76fe1f7f6f251114919247445fb5cb3734
tree33bc9a16d96a61ae9818dcc3f12825c6b8034566
parent6a5ad251b7cdb990a3705428aef408433f05614a
Bluetooth: hci_event: Fix Invalid wait context

This fixes the following trace caused by attempting to lock
cmd_sync_work_lock while holding the rcu_read_lock:

kworker/u3:2/212 is trying to lock:
ffff888002600910 (&hdev->cmd_sync_work_lock){+.+.}-{3:3}, at:
hci_cmd_sync_queue+0xad/0x140
other info that might help us debug this:
context-{4:4}
4 locks held by kworker/u3:2/212:
 #0: ffff8880028c6530 ((wq_completion)hci0#2){+.+.}-{0:0}, at:
 process_one_work+0x4dc/0x9a0
 #1: ffff888001aafde0 ((work_completion)(&hdev->rx_work)){+.+.}-{0:0},
 at: process_one_work+0x4dc/0x9a0
 #2: ffff888002600070 (&hdev->lock){+.+.}-{3:3}, at:
 hci_cc_le_set_cig_params+0x64/0x4f0
 #3: ffffffffa5994b00 (rcu_read_lock){....}-{1:2}, at:
 hci_cc_le_set_cig_params+0x2f9/0x4f0

Fixes: 26afbd826ee3 ("Bluetooth: Add initial implementation of CIS connections")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_event.c