Skip to content

Commit

Permalink
Bluetooth: Always set event mask on suspend
Browse files Browse the repository at this point in the history
When suspending, always set the event mask once disconnects are
successful. Otherwise, if wakeup is disallowed, the event mask is not
set before suspend continues and can result in an early wakeup.

Fixes: 182ee45 ("Bluetooth: hci_sync: Rework hci_suspend_notifier")
Cc: [email protected]
Signed-off-by: Abhishek Pandit-Subedi <[email protected]>
Signed-off-by: Luiz Augusto von Dentz <[email protected]>
  • Loading branch information
apandit authored and Vudentz committed Jul 26, 2022
1 parent 4b2f4e0 commit ef61b6e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions net/bluetooth/hci_sync.c
Original file line number Diff line number Diff line change
Expand Up @@ -4973,6 +4973,9 @@ int hci_suspend_sync(struct hci_dev *hdev)
return err;
}

/* Update event mask so only the allowed event can wakeup the host */
hci_set_event_mask_sync(hdev);

/* Only configure accept list if disconnect succeeded and wake
* isn't being prevented.
*/
Expand All @@ -4984,9 +4987,6 @@ int hci_suspend_sync(struct hci_dev *hdev)
/* Unpause to take care of updating scanning params */
hdev->scanning_paused = false;

/* Update event mask so only the allowed event can wakeup the host */
hci_set_event_mask_sync(hdev);

/* Enable event filter for paired devices */
hci_update_event_filter_sync(hdev);

Expand Down

0 comments on commit ef61b6e

Please sign in to comment.