Skip to content

Commit

Permalink
Merge tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/bluetooth/bluetooth

Luiz Augusto von Dentz says:

====================
bluetooth pull request for net:

 - Fix deadlock when powering on.

* tag 'for-net-2022-07-05' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth:
  Bluetooth: core: Fix deadlock on hci_power_on_sync.
====================

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
  • Loading branch information
kuba-moo committed Jul 5, 2022
2 parents 029cc09 + e36bea6 commit 26c1272
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 3 additions & 0 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -571,6 +571,7 @@ int hci_dev_close(__u16 dev)
goto done;
}

cancel_work_sync(&hdev->power_on);
if (hci_dev_test_and_clear_flag(hdev, HCI_AUTO_OFF))
cancel_delayed_work(&hdev->power_off);

Expand Down Expand Up @@ -2675,6 +2676,8 @@ void hci_unregister_dev(struct hci_dev *hdev)
list_del(&hdev->list);
write_unlock(&hci_dev_list_lock);

cancel_work_sync(&hdev->power_on);

hci_cmd_sync_clear(hdev);

if (!test_bit(HCI_QUIRK_NO_SUSPEND_NOTIFIER, &hdev->quirks))
Expand Down
1 change: 0 additions & 1 deletion net/bluetooth/hci_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -4088,7 +4088,6 @@ int hci_dev_close_sync(struct hci_dev *hdev)

bt_dev_dbg(hdev, "");

cancel_work_sync(&hdev->power_on);
cancel_delayed_work(&hdev->power_off);
cancel_delayed_work(&hdev->ncmd_timer);

Expand Down

0 comments on commit 26c1272

Please sign in to comment.