Skip to content

Commit

Permalink
Bluetooth: hci_core: Fix not handling hibernation actions
Browse files Browse the repository at this point in the history
This fixes not handling hibernation actions on suspend notifier so they
are treated in the same way as regular suspend actions.

Fixes: 9952d90 ("Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
  • Loading branch information
Vudentz committed Aug 23, 2024
1 parent 3523747 commit 18b3256
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 18b3256

Please sign in to comment.