Commit a66dfaf
committed
Bluetooth: MGMT: Fix possible deadlocks
This fixes possible deadlocks like the following caused by
hci_cmd_sync_dequeue causing the destroy function to run:
INFO: task kworker/u19:0:143 blocked for more than 120 seconds.
Tainted: G W O 6.8.0-2024-03-19-intel-next-iLS-24ww14 #1
"echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
task:kworker/u19:0 state:D stack:0 pid:143 tgid:143 ppid:2 flags:0x00004000
Workqueue: hci0 hci_cmd_sync_work [bluetooth]
Call Trace:
<TASK>
__schedule+0x374/0xaf0
schedule+0x3c/0xf0
schedule_preempt_disabled+0x1c/0x30
__mutex_lock.constprop.0+0x3ef/0x7a0
__mutex_lock_slowpath+0x13/0x20
mutex_lock+0x3c/0x50
mgmt_set_connectable_complete+0xa4/0x150 [bluetooth]
? kfree+0x211/0x2a0
hci_cmd_sync_dequeue+0xae/0x130 [bluetooth]
? __pfx_cmd_complete_rsp+0x10/0x10 [bluetooth]
cmd_complete_rsp+0x26/0x80 [bluetooth]
mgmt_pending_foreach+0x4d/0x70 [bluetooth]
__mgmt_power_off+0x8d/0x180 [bluetooth]
? _raw_spin_unlock_irq+0x23/0x40
hci_dev_close_sync+0x445/0x5b0 [bluetooth]
hci_set_powered_sync+0x149/0x250 [bluetooth]
set_powered_sync+0x24/0x60 [bluetooth]
hci_cmd_sync_work+0x90/0x150 [bluetooth]
process_one_work+0x13e/0x300
worker_thread+0x2f7/0x420
? __pfx_worker_thread+0x10/0x10
kthread+0x107/0x140
? __pfx_kthread+0x10/0x10
ret_from_fork+0x3d/0x60
? __pfx_kthread+0x10/0x10
ret_from_fork_asm+0x1b/0x30
</TASK>
Tested-by: Kiran K <kiran.k@intel.com>
Fixes: f53e1c9 ("Bluetooth: MGMT: Fix possible crash on mgmt_index_removed")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>1 parent 0b88294 commit a66dfaf
1 file changed
+18
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1518 | 1518 | | |
1519 | 1519 | | |
1520 | 1520 | | |
1521 | | - | |
| 1521 | + | |
| 1522 | + | |
1522 | 1523 | | |
1523 | 1524 | | |
1524 | 1525 | | |
| |||
1692 | 1693 | | |
1693 | 1694 | | |
1694 | 1695 | | |
1695 | | - | |
| 1696 | + | |
| 1697 | + | |
1696 | 1698 | | |
1697 | 1699 | | |
1698 | 1700 | | |
| |||
1924 | 1926 | | |
1925 | 1927 | | |
1926 | 1928 | | |
1927 | | - | |
| 1929 | + | |
1928 | 1930 | | |
1929 | 1931 | | |
1930 | 1932 | | |
| |||
3848 | 3850 | | |
3849 | 3851 | | |
3850 | 3852 | | |
3851 | | - | |
| 3853 | + | |
| 3854 | + | |
3852 | 3855 | | |
3853 | 3856 | | |
3854 | 3857 | | |
| |||
4023 | 4026 | | |
4024 | 4027 | | |
4025 | 4028 | | |
4026 | | - | |
| 4029 | + | |
| 4030 | + | |
4027 | 4031 | | |
4028 | 4032 | | |
4029 | 4033 | | |
| |||
5914 | 5918 | | |
5915 | 5919 | | |
5916 | 5920 | | |
| 5921 | + | |
| 5922 | + | |
| 5923 | + | |
| 5924 | + | |
| 5925 | + | |
5917 | 5926 | | |
5918 | 5927 | | |
5919 | 5928 | | |
5920 | 5929 | | |
5921 | 5930 | | |
5922 | | - | |
5923 | | - | |
5924 | 5931 | | |
5925 | 5932 | | |
5926 | 5933 | | |
| |||
6153 | 6160 | | |
6154 | 6161 | | |
6155 | 6162 | | |
6156 | | - | |
| 6163 | + | |
| 6164 | + | |
6157 | 6165 | | |
6158 | 6166 | | |
6159 | 6167 | | |
| |||
8144 | 8152 | | |
8145 | 8153 | | |
8146 | 8154 | | |
8147 | | - | |
| 8155 | + | |
| 8156 | + | |
8148 | 8157 | | |
8149 | 8158 | | |
8150 | 8159 | | |
| |||
0 commit comments