2022-08-11 21:30:12

by Luiz Augusto von Dentz

[permalink] [raw]
Subject: [PATCH] Bluetooth: hci_sync: Fix suspend performance regression

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

This attempts to fix suspend performance when there is no connections by
not updating the event mask.

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
---
net/bluetooth/hci_sync.c | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
index 6de2ad730995..74a0cd5d0b37 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -5549,17 +5549,21 @@ int hci_suspend_sync(struct hci_dev *hdev)
/* Prevent disconnects from causing scanning to be re-enabled */
hci_pause_scan_sync(hdev);

- /* Soft disconnect everything (power off) */
- err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF);
- if (err) {
- /* Set state to BT_RUNNING so resume doesn't notify */
- hdev->suspend_state = BT_RUNNING;
- hci_resume_sync(hdev);
- return err;
- }
+ if (hci_conn_count(hdev)) {
+ /* Soft disconnect everything (power off) */
+ err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF);
+ if (err) {
+ /* Set state to BT_RUNNING so resume doesn't notify */
+ hdev->suspend_state = BT_RUNNING;
+ hci_resume_sync(hdev);
+ return err;
+ }

- /* Update event mask so only the allowed event can wakeup the host */
- hci_set_event_mask_sync(hdev);
+ /* Update event mask so only the allowed event can wakeup the
+ * host.
+ */
+ hci_set_event_mask_sync(hdev);
+ }

/* Only configure accept list if disconnect succeeded and wake
* isn't being prevented.
--
2.37.1


2022-08-11 22:10:56

by bluez.test.bot

[permalink] [raw]
Subject: RE: Bluetooth: hci_sync: Fix suspend performance regression

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=667005

---Test result---

Test Summary:
CheckPatch PASS 0.88 seconds
GitLint PASS 0.47 seconds
SubjectPrefix PASS 0.29 seconds
BuildKernel PASS 32.86 seconds
BuildKernel32 PASS 29.48 seconds
Incremental Build with patchesPASS 42.50 seconds
TestRunner: Setup PASS 491.87 seconds
TestRunner: l2cap-tester PASS 17.10 seconds
TestRunner: bnep-tester PASS 6.38 seconds
TestRunner: mgmt-tester PASS 104.11 seconds
TestRunner: rfcomm-tester PASS 10.03 seconds
TestRunner: sco-tester PASS 9.69 seconds
TestRunner: smp-tester PASS 9.66 seconds
TestRunner: userchan-tester PASS 6.73 seconds



---
Regards,
Linux Bluetooth

2022-08-17 19:05:04

by patchwork-bot+bluetooth

[permalink] [raw]
Subject: Re: [PATCH] Bluetooth: hci_sync: Fix suspend performance regression

Hello:

This patch was applied to bluetooth/bluetooth-next.git (master)
by Luiz Augusto von Dentz <[email protected]>:

On Thu, 11 Aug 2022 14:24:35 -0700 you wrote:
> From: Luiz Augusto von Dentz <[email protected]>
>
> This attempts to fix suspend performance when there is no connections by
> not updating the event mask.
>
> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
>
> [...]

Here is the summary with links:
- Bluetooth: hci_sync: Fix suspend performance regression
https://git.kernel.org/bluetooth/bluetooth-next/c/4e9f7d8bd56f

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html