blob: 8715bbc5114e507a14acc42cde1829be6960ac2c [file] [log] [blame]
From e974d233ef68255c0505f78cc02242dc57ea96d2 Mon Sep 17 00:00:00 2001
From: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Date: Tue, 21 Jun 2022 18:35:10 -0700
Subject: [PATCH] CHROMIUM: bluetooth: Remove Mode Change from suspend event
mask
When a device is disconnected, we may also get a Mode Change response
from the controller prior to the Disconnect Complete. For suspend, we
need to mask both events.
BUG=b:231741170,b:236239671
TEST=Verify suspend on trogdor
Signed-off-by: Abhishek Pandit-Subedi <abhishekpandit@chromium.org>
Signed-off-by: Zhengping Jiang <jiangzp@google.com>
---
net/bluetooth/hci_sync.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 54ad22171b99a6f0dd4bf4cf72b44024fada6ebb..a9b87e42bd77a28b3c260ebcf77bd1e719de5421 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -3764,10 +3764,13 @@ static int hci_set_event_mask_sync(struct hci_dev *hdev)
if (hdev->commands[0] & 0x20) {
/* Don't set Disconnect Complete when suspended as that
* would wakeup the host when disconnecting due to
- * suspend.
+ * suspend. Also unset Mode Change while suspending for
+ * the same reason.
*/
- if (!hdev->suspended)
+ if (!hdev->suspended) {
events[0] |= 0x10; /* Disconnection Complete */
+ events[2] |= 0x08; /* Mode Change */
+ }
events[2] |= 0x04; /* Number of Completed Packets */
events[3] |= 0x02; /* Data Buffer Overflow */
}
--
2.43.0.429.g432eaa2c6b-goog