summaryrefslogtreecommitdiffstats
path: root/net/bluetooth
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-08-21 14:41:52 -0400
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-08-23 15:56:04 -0400
commit18b3256db76bd1130965acd99fbd38f87c3e6950 (patch)
tree57a549f18a776300d3b21e67036cbf11a7f8ef4f /net/bluetooth
parent35237475384ab3622f63c3c09bdf6af6dacfe9c3 (diff)
downloadlinux-stable-18b3256db76bd1130965acd99fbd38f87c3e6950.tar.gz
linux-stable-18b3256db76bd1130965acd99fbd38f87c3e6950.tar.bz2
linux-stable-18b3256db76bd1130965acd99fbd38f87c3e6950.zip
Bluetooth: hci_core: Fix not handling hibernation actions
This fixes not handling hibernation actions on suspend notifier so they are treated in the same way as regular suspend actions. Fixes: 9952d90ea288 ("Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND") Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'net/bluetooth')
-rw-r--r--net/bluetooth/hci_core.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index f25a21f532aa..d6976db02c06 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2406,10 +2406,16 @@ static int hci_suspend_notifier(struct notifier_block *nb, unsigned long action,
/* To avoid a potential race with hci_unregister_dev. */
hci_dev_hold(hdev);
- if (action == PM_SUSPEND_PREPARE)
+ switch (action) {
+ case PM_HIBERNATION_PREPARE:
+ case PM_SUSPEND_PREPARE:
ret = hci_suspend_dev(hdev);
- else if (action == PM_POST_SUSPEND)
+ break;
+ case PM_POST_HIBERNATION:
+ case PM_POST_SUSPEND:
ret = hci_resume_dev(hdev);
+ break;
+ }
if (ret)
bt_dev_err(hdev, "Suspend notifier action (%lu) failed: %d",