Skip to contentSkip to conversation

Bluetooth: btusb: Don't suspend when there are connections

PATCH Superseded Luiz Augusto von Dentz 1 participant 1 message Feb 24, 2023 Bluetooth drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 Bluetooth: btusb: Don't suspend when there are connections

From: Luiz Augusto von Dentz <[email protected]>

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.

---
 drivers/bluetooth/btusb.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/bluetooth/btusb.c +4 -0
index 6273a93defd2..279d9e89c646 100644
@@ -4258,6 +4258,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;
 
Signature · 1 line
2.37.3