Bluetooth: hci_sync: Fix suspend performance regression

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

Fixes: ef61b6ea ("Bluetooth: Always set event mask on suspend")
Signed-off-by: default avatarLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
parent b82a26d8
...@@ -5288,17 +5288,21 @@ int hci_suspend_sync(struct hci_dev *hdev) ...@@ -5288,17 +5288,21 @@ int hci_suspend_sync(struct hci_dev *hdev)
/* Prevent disconnects from causing scanning to be re-enabled */ /* Prevent disconnects from causing scanning to be re-enabled */
hci_pause_scan_sync(hdev); hci_pause_scan_sync(hdev);
/* Soft disconnect everything (power off) */ if (hci_conn_count(hdev)) {
err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF); /* Soft disconnect everything (power off) */
if (err) { err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF);
/* Set state to BT_RUNNING so resume doesn't notify */ if (err) {
hdev->suspend_state = BT_RUNNING; /* Set state to BT_RUNNING so resume doesn't notify */
hci_resume_sync(hdev); hdev->suspend_state = BT_RUNNING;
return err; hci_resume_sync(hdev);
} return err;
}
/* Update event mask so only the allowed event can wakeup the host */ /* Update event mask so only the allowed event can wakeup the
hci_set_event_mask_sync(hdev); * host.
*/
hci_set_event_mask_sync(hdev);
}
/* Only configure accept list if disconnect succeeded and wake /* Only configure accept list if disconnect succeeded and wake
* isn't being prevented. * isn't being prevented.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment