summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2024-08-21 14:41:52 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-04 13:25:01 +0200
commit9f3d456e5b4680f3f11a068baa5385403393b9eb (patch)
tree7403430a8d35040a33e9a8b95aed0ebab4b38043 /net
parent00041c90a8cbbd7be9c3b606991f65c12ecd11c5 (diff)
downloadlinux-9f3d456e5b4680f3f11a068baa5385403393b9eb.tar.gz
linux-9f3d456e5b4680f3f11a068baa5385403393b9eb.tar.bz2
linux-9f3d456e5b4680f3f11a068baa5385403393b9eb.zip
Bluetooth: hci_core: Fix not handling hibernation actions
[ Upstream commit 18b3256db76bd1130965acd99fbd38f87c3e6950 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net')
-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 210e03a3609d..dc19a0b1a2f6 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -2405,10 +2405,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",