Skip to content

Commit 18b3256

Browse files
committed
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: 9952d90 ("Bluetooth: Handle PM_SUSPEND_PREPARE and PM_POST_SUSPEND") Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent 3523747 commit 18b3256

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

net/bluetooth/hci_core.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2406,10 +2406,16 @@ static int hci_suspend_notifier(struct notifier_block *nb, unsigned long action,
24062406
/* To avoid a potential race with hci_unregister_dev. */
24072407
hci_dev_hold(hdev);
24082408

2409-
if (action == PM_SUSPEND_PREPARE)
2409+
switch (action) {
2410+
case PM_HIBERNATION_PREPARE:
2411+
case PM_SUSPEND_PREPARE:
24102412
ret = hci_suspend_dev(hdev);
2411-
else if (action == PM_POST_SUSPEND)
2413+
break;
2414+
case PM_POST_HIBERNATION:
2415+
case PM_POST_SUSPEND:
24122416
ret = hci_resume_dev(hdev);
2417+
break;
2418+
}
24132419

24142420
if (ret)
24152421
bt_dev_err(hdev, "Suspend notifier action (%lu) failed: %d",

0 commit comments

Comments
 (0)