From: Marcel Holtmann Date: Tue, 30 Oct 2012 08:35:40 +0000 (-0700) Subject: Bluetooth: Notify about device registration before power on X-Git-Tag: v4.13~10659^2~3^2~8^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=fbe96d6ff9f4e361e1b2ec0a30140e17af7e3854;p=mirror_ubuntu-bionic-kernel.git Bluetooth: Notify about device registration before power on 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 Acked-by: Johan Hedberg Signed-off-by: Gustavo Padovan --- diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index 8a0ce706aebd..a0a2f97b9c62 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c @@ -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: