]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
Bluetooth: hci_sync: fix BR/EDR wakeup bug
authorclancy shang <clancy.shang@quectel.com>
Mon, 18 Dec 2023 10:24:17 +0000 (18:24 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 5 Feb 2024 20:16:56 +0000 (20:16 +0000)
[ Upstream commit d4b70ba1eab450eff9c5ef536f07c01d424b7eda ]

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 <clancy.shang@quectel.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/bluetooth/hci_sync.c

index d85a7091a1169d714849aeb4f4c7b6967c8a51c1..97284d9b2a2e3855aa234a8a4c35e878072ddb36 100644 (file)
@@ -3800,12 +3800,14 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
        if (lmp_bredr_capable(hdev)) {
                events[4] |= 0x01; /* Flow Specification Complete */
 
-               /* Don't set Disconnect Complete when suspended as that
-                * would wakeup the host when disconnecting due to
-                * suspend.
+               /* Don't set Disconnect Complete and mode change when
+                * suspended as that would wakeup the host when disconnecting
+                * due to suspend.
                 */
-               if (hdev->suspended)
+               if (hdev->suspended) {
                        events[0] &= 0xef;
+                       events[2] &= 0xf7;
+               }
        } else {
                /* Use a different default for LE-only devices */
                memset(events, 0, sizeof(events));