2020-11-09 07:58:41

by Yun-hao Chung

[permalink] [raw]
Subject: [PATCH v7 2/5] Bluetooth: Handle system suspend resume case

This patch adds code to handle the system suspension during interleave
scan. The interleave scan will be canceled when the system is going to
sleep, and will be restarted after waking up.

Commit-changes 5:
- Remove the change in hci_req_config_le_suspend_scan

Signed-off-by: Howard Chung <[email protected]>
Reviewed-by: Alain Michaud <[email protected]>
Reviewed-by: Manish Mandlik <[email protected]>
Reviewed-by: Abhishek Pandit-Subedi <[email protected]>
Reviewed-by: Miao-chen Chou <[email protected]>
---

(no changes since v1)

net/bluetooth/hci_request.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c
index 70ea126f56282..b615b981be9d6 100644
--- a/net/bluetooth/hci_request.c
+++ b/net/bluetooth/hci_request.c
@@ -1284,8 +1284,10 @@ void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next)
hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, 1, &page_scan);

/* Disable LE passive scan if enabled */
- if (hci_dev_test_flag(hdev, HCI_LE_SCAN))
+ if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) {
+ cancel_interleave_scan(hdev);
hci_req_add_le_scan_disable(&req, false);
+ }

/* Mark task needing completion */
set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks);
--
2.29.2.222.g5d2a92d10f8-goog


2020-11-09 12:26:02

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH v7 2/5] Bluetooth: Handle system suspend resume case

Hi Howard,

> This patch adds code to handle the system suspension during interleave
> scan. The interleave scan will be canceled when the system is going to
> sleep, and will be restarted after waking up.
>
> Commit-changes 5:
> - Remove the change in hci_req_config_le_suspend_scan

this does not belong here. So please avoid this in the future.

> Signed-off-by: Howard Chung <[email protected]>
> Reviewed-by: Alain Michaud <[email protected]>
> Reviewed-by: Manish Mandlik <[email protected]>
> Reviewed-by: Abhishek Pandit-Subedi <[email protected]>
> Reviewed-by: Miao-chen Chou <[email protected]>
> ---
>
> (no changes since v1)
>
> net/bluetooth/hci_request.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)

Patch has been applied to bluetooth-next tree.

Regards

Marcel