Skip to content

Commit

Permalink
Bluetooth: Always set event mask on suspend
Browse files Browse the repository at this point in the history
commit ef61b6e upstream.

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: stable@vger.kernel.org
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
apandit authored and gregkh committed Aug 3, 2022
1 parent 3740a5d commit d50f255
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 @@ -4942,6 +4942,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 @@ -4953,9 +4956,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 d50f255

Please sign in to comment.