summaryrefslogtreecommitdiff
path: root/drivers/bluetooth/btusb.c
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-05-03 01:11:59 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2023-12-22 20:54:30 +0300
commit4e0a1d8b06751d9ea8357e1f29f6b31465856665 (patch)
tree554c972b6f133f7f384bdadc14fd7cacdddde5df /drivers/bluetooth/btusb.c
parent5d192b697c7417254cdd9edc3d5e9e0364eb9045 (diff)
downloadlinux-4e0a1d8b06751d9ea8357e1f29f6b31465856665.tar.xz
Bluetooth: btusb: Don't suspend when there are connections
This checks if there are connections before suspending since that may disrupt the connections making it stop receiving any data if remote wakeup is not enabled. Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth/btusb.c')
-rw-r--r--drivers/bluetooth/btusb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index b8e9de887b5d..0926e4451802 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4629,6 +4629,10 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
BT_DBG("intf %p", intf);
+ /* Don't suspend if there are connections */
+ if (hci_conn_count(data->hdev))
+ return -EBUSY;
+
if (data->suspend_count++)
return 0;