diff options
author | Manish Mandlik <mmandlik@google.com> | 2021-09-21 23:47:10 +0200 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2021-09-28 10:01:35 +0200 |
commit | ce81843be24e9d5deb0db0784815efe84c9e3f22 (patch) | |
tree | 664a4b98e7c91df0863e58f845a6eafdf402a308 /net/bluetooth/msft.h | |
parent | Bluetooth: hci_h5: directly return hci_uart_register_device() ret-val (diff) | |
download | linux-ce81843be24e9d5deb0db0784815efe84c9e3f22.tar.xz linux-ce81843be24e9d5deb0db0784815efe84c9e3f22.zip |
Bluetooth: Fix Advertisement Monitor Suspend/Resume
During system suspend, advertisement monitoring is disabled by setting
the HCI_VS_MSFT_LE_Set_Advertisement_Filter_Enable to False. This
disables the monitoring during suspend, however, if the controller is
monitoring a device, it sends HCI_VS_MSFT_LE_Monitor_Device_Event to
indicate that the monitoring has been stopped for that particular
device. This event may occur after suspend depending on the
low_threshold_timeout and peer device advertisement frequency, which
causes early wake up.
Right way to disable the monitoring for suspend is by removing all the
monitors before suspend and re-monitor after resume to ensure no events
are received during suspend. This patch fixes this suspend/resume issue.
Following tests are performed:
- Add monitors before suspend and make sure DeviceFound gets triggered
- Suspend the system and verify that all monitors are removed by kernel
but not Released by bluetoothd
- Wake up and verify that all monitors are added again and DeviceFound
gets triggered
Signed-off-by: Manish Mandlik <mmandlik@google.com>
Reviewed-by: Archie Pusaka <apusaka@google.com>
Reviewed-by: Miao-chen Chou <mcchou@google.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/msft.h')
-rw-r--r-- | net/bluetooth/msft.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/net/bluetooth/msft.h b/net/bluetooth/msft.h index 8018948c5975..59c6e081c789 100644 --- a/net/bluetooth/msft.h +++ b/net/bluetooth/msft.h @@ -24,6 +24,8 @@ int msft_remove_monitor(struct hci_dev *hdev, struct adv_monitor *monitor, u16 handle); void msft_req_add_set_filter_enable(struct hci_request *req, bool enable); int msft_set_filter_enable(struct hci_dev *hdev, bool enable); +void msft_suspend(struct hci_dev *hdev); +void msft_resume(struct hci_dev *hdev); bool msft_curve_validity(struct hci_dev *hdev); #else @@ -59,6 +61,9 @@ static inline int msft_set_filter_enable(struct hci_dev *hdev, bool enable) return -EOPNOTSUPP; } +static inline void msft_suspend(struct hci_dev *hdev) {} +static inline void msft_resume(struct hci_dev *hdev) {} + static inline bool msft_curve_validity(struct hci_dev *hdev) { return false; |