Bluetooth: Notify about device registration before power on
Subsystems (2)
Marcel Holtmann
maintainerPATCH 1/1 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.
--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/bluetooth/hci_core.c +2 -2
@@ -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:
Signature · 1 line
1.7.11.7
Hi Marcel,
Quoted 11 lines · Marcel Holtmann
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 <[email protected]>--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Johan
Hi Marcel,
Quoted 11 lines · Marcel Holtmann
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 <[email protected]>--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Patch has been applied to bluetooth-next. Thanks.
Gustavo
Hi Gustavo,
Quoted 7 lines · Gustavo Padovan
Quoted 7 lines
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.
Quoted 6 lines
Quoted 4 lines
Signed-off-by Marcel Holtmann <[email protected]>--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Patch has been applied to bluetooth-next. Thanks.
I guess you mean bluetooth.git? (that's where the patch is right now - not bluetooth-next). Also, I don't think the Cc: stable addition was necessary since this scheduling behavior seems to be something only introduced for 3.7 (not 100% sure about this though).
Johan
Marcel Holtmann
maintainerHi Gustavo,
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
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 <[email protected]>--- net/bluetooth/hci_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Quoted 6 lines
Quoted 1 line
Patch has been applied to bluetooth-next. Thanks.
I guess you mean bluetooth.git? (that's where the patch is right now - not bluetooth-next). Also, I don't think the Cc: stable addition was necessary since this scheduling behavior seems to be something only introduced for 3.7 (not 100% sure about this though).
I did not send this to stable, because I think it is 3.7-rc only behavior. Feel free to test it. With the help of btmon it is really easy to see if the New Index event arrives before the first HCI command or not. Remember that this only applies for newly attached devices and btmon already running.
Regards
Marcel