Skip to content

Commit

Permalink
Bluetooth: Notify about device registration before power on
Browse files Browse the repository at this point in the history
It is important that the monitor interface gets notified about
a new device before its power on procedure has been started.

For some reason that is no longer working as expected and the power
on procedure runs first. It is safe to just notify about device
registration and trigger the power on procedure afterwards.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
  • Loading branch information
holtmann authored and Gustavo Padovan committed Nov 9, 2012
1 parent 896ea28 commit fbe96d6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1754,11 +1754,11 @@ int hci_register_dev(struct hci_dev *hdev)
if (hdev->dev_type != HCI_AMP)
set_bit(HCI_AUTO_OFF, &hdev->dev_flags);

schedule_work(&hdev->power_on);

hci_notify(hdev, HCI_DEV_REG);
hci_dev_hold(hdev);

schedule_work(&hdev->power_on);

return id;

err_wqueue:
Expand Down

0 comments on commit fbe96d6

Please sign in to comment.