linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH v2 0/4] Bluetooth: Handle system suspend gracefully
@ 2020-01-28  1:58 Abhishek Pandit-Subedi
  2020-01-28  1:58 ` [RFC PATCH v2 1/4] Bluetooth: Add mgmt op set_wake_capable Abhishek Pandit-Subedi
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Abhishek Pandit-Subedi @ 2020-01-28  1:58 UTC (permalink / raw)
  To: marcel, luiz.dentz, alainm
  Cc: linux-bluetooth, chromeos-bluetooth-upstreaming,
	Abhishek Pandit-Subedi, David S. Miller, Johan Hedberg, netdev,
	linux-kernel, Jakub Kicinski


Hi linux-bluetooth,

This patch series prepares the Bluetooth controller for system suspend
by disconnecting all devices and preparing the event filter and LE
whitelist with devices that can wake the system from suspend.

The main motivation for doing this is so we can enable Bluetooth as
a wake up source during suspend without it being noisy. Bluetooth should
wake the system when a HID device receives user input but otherwise not
send any events to the host.

This patch series was tested on several Chromebooks with both btusb and
hci_serdev on kernel 4.19. The set of tests was basically the following:
* Reconnects after suspend succeed
* HID devices can wake the system from suspend (needs some related bluez
  changes to call the Set Wake Capable management command)
* System properly pauses and unpauses discovery + advertising around
  suspend
* System does not wake from any events from non wakeable devices

Series 2 has refactored the change into multiple smaller commits as
requested. I tried to simplify some of the whitelist filtering edge
cases but unfortunately it remains quite complex.

Please review and provide any feedback.

Thanks
Abhishek


Changes in v2:
* Moved pm notifier registration into its own patch and moved params out
  of separate suspend_state
* Refactored filters and whitelist settings to its own patch
* Refactored update_white_list to have clearer edge cases
* Add connected devices to whitelist (previously missing corner case)
* Refactored pause discovery + advertising into its own patch

Abhishek Pandit-Subedi (4):
  Bluetooth: Add mgmt op set_wake_capable
  Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND
  Bluetooth: Update filters/whitelists for suspend
  Bluetooth: Pause discovery and advertising during suspend

 include/net/bluetooth/hci.h      |  17 +-
 include/net/bluetooth/hci_core.h |  38 ++++
 include/net/bluetooth/mgmt.h     |   7 +
 net/bluetooth/hci_core.c         |  71 ++++++
 net/bluetooth/hci_event.c        |  28 ++-
 net/bluetooth/hci_request.c      | 370 ++++++++++++++++++++++++++-----
 net/bluetooth/hci_request.h      |   2 +
 net/bluetooth/mgmt.c             |  89 ++++++++
 8 files changed, 554 insertions(+), 68 deletions(-)

-- 
2.25.0.341.g760bfbb309-goog


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-02-18 18:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-28  1:58 [RFC PATCH v2 0/4] Bluetooth: Handle system suspend gracefully Abhishek Pandit-Subedi
2020-01-28  1:58 ` [RFC PATCH v2 1/4] Bluetooth: Add mgmt op set_wake_capable Abhishek Pandit-Subedi
2020-01-29  4:42   ` Marcel Holtmann
2020-01-28  1:58 ` [RFC PATCH v2 2/4] Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND Abhishek Pandit-Subedi
2020-01-28  1:58 ` [RFC PATCH v2 3/4] Bluetooth: Update filters/whitelists for suspend Abhishek Pandit-Subedi
2020-01-29  8:40   ` Marcel Holtmann
2020-01-29 19:04     ` Abhishek Pandit-Subedi
2020-02-13  8:29       ` Marcel Holtmann
2020-02-18 18:29         ` Abhishek Pandit-Subedi
2020-01-28  1:58 ` [RFC PATCH v2 4/4] Bluetooth: Pause discovery and advertising during suspend Abhishek Pandit-Subedi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).