Skip to content

Commit 88cd6e6

Browse files
joeyliVudentz
authored andcommitted
Bluetooth: hci_sync: Using hci_cmd_sync_submit when removing Adv Monitor
Since the d883a46 be introduced in v6.4, bluetooth daemon got the following failed message of MGMT_OP_REMOVE_ADV_MONITOR command when controller is power-off: bluetoothd[20976]: src/adapter.c:reset_adv_monitors_complete() Failed to reset Adv Monitors: Failed> Normally this situation is happened when the bluetoothd deamon be started manually after system booting. Which means that bluetoothd received MGMT_EV_INDEX_ADDED event after kernel runs hci_power_off(). Base on doc/mgmt-api.txt, the MGMT_OP_REMOVE_ADV_MONITOR command can be used when the controller is not powered. This patch changes the code in remove_adv_monitor() to use hci_cmd_sync_submit() instead of hci_cmd_sync_queue(). Fixes: d883a46 ("Bluetooth: hci_sync: Only allow hci_cmd_sync_queue if running") Cc: Luiz Augusto von Dentz <[email protected]> Cc: Manish Mandlik <[email protected]> Cc: Archie Pusaka <[email protected]> Cc: Miao-chen Chou <[email protected]> Signed-off-by: Chun-Yi Lee <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 7ddb9de commit 88cd6e6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

net/bluetooth/mgmt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5485,8 +5485,8 @@ static int remove_adv_monitor(struct sock *sk, struct hci_dev *hdev,
54855485
goto unlock;
54865486
}
54875487

5488-
err = hci_cmd_sync_queue(hdev, mgmt_remove_adv_monitor_sync, cmd,
5489-
mgmt_remove_adv_monitor_complete);
5488+
err = hci_cmd_sync_submit(hdev, mgmt_remove_adv_monitor_sync, cmd,
5489+
mgmt_remove_adv_monitor_complete);
54905490

54915491
if (err) {
54925492
mgmt_pending_remove(cmd);

0 commit comments

Comments
 (0)