Skip to content

Commit d4b70ba

Browse files
clancy shangVudentz
authored andcommitted
Bluetooth: hci_sync: fix BR/EDR wakeup bug
when Bluetooth set the event mask and enter suspend, the controller has hci mode change event coming, it cause controller can not enter sleep mode. so it should to set the hci mode change event mask before enter suspend. Signed-off-by: clancy shang <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 3c83800 commit d4b70ba

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

net/bluetooth/hci_sync.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3732,12 +3732,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
37323732
if (lmp_bredr_capable(hdev)) {
37333733
events[4] |= 0x01; /* Flow Specification Complete */
37343734

3735-
/* Don't set Disconnect Complete when suspended as that
3736-
* would wakeup the host when disconnecting due to
3737-
* suspend.
3735+
/* Don't set Disconnect Complete and mode change when
3736+
* suspended as that would wakeup the host when disconnecting
3737+
* due to suspend.
37383738
*/
3739-
if (hdev->suspended)
3739+
if (hdev->suspended) {
37403740
events[0] &= 0xef;
3741+
events[2] &= 0xf7;
3742+
}
37413743
} else {
37423744
/* Use a different default for LE-only devices */
37433745
memset(events, 0, sizeof(events));

0 commit comments

Comments
 (0)