[PATCH] Bluetooth: btusb: Disable Bluetooth controller during S3

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We've found there are several systems got woken up from S3 by Bluetooth
controller.

We do want the system to be able to be woken up by Bluetooth devices
from Suspend2Idle, but not from S3.

Unconditionally disables Bluetooth controller during S3 to avoid this
issue.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=199451
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=200039
Signed-off-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx>
---
 drivers/bluetooth/btusb.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 572fd75fbcf6..60f2832c4ff2 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -3290,6 +3290,9 @@ static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
 		enable_irq(data->oob_wake_irq);
 	}
 
+	if (!PMSG_IS_AUTO(message) && pm_suspend_via_firmware())
+		interface_to_usbdev(intf)->quirks |= USB_QUIRK_DISCONNECT_SUSPEND;
+
 	return 0;
 }
 
@@ -3334,6 +3337,9 @@ static int btusb_resume(struct usb_interface *intf)
 	if (--data->suspend_count)
 		return 0;
 
+	if (pm_resume_via_firmware())
+		interface_to_usbdev(intf)->quirks &= ~USB_QUIRK_DISCONNECT_SUSPEND;
+
 	/* Disable only if not already disabled (keep it balanced) */
 	if (test_and_clear_bit(BTUSB_OOB_WAKE_ENABLED, &data->flags)) {
 		disable_irq(data->oob_wake_irq);
-- 
2.17.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux