diff mbox series

[V2] power: add PM_SUSPEND_MAX in pm_suspend_target_state

Message ID 7df8dcd0-c242-5001-b31b-4192afdf7a68@kylinos.cn (mailing list archive)
State New
Headers show
Series [V2] power: add PM_SUSPEND_MAX in pm_suspend_target_state | expand

Commit Message

lijun Nov. 11, 2024, 7:11 a.m. UTC
From 65249bb9b422d249c972eac66b763c4c7f30bbce Mon Sep 17 00:00:00 2001
From: Li Jun <lijun01@kylinos.cn>
Date: Fri, 1 Nov 2024 16:31:33 +0800
Subject: [PATCH] power: add PM_SUSPEND_MAX in pm_suspend_target_state

The system is switching to  disk sleep, when executing
to freeze_processes(),one of processes may be get the
system state, but the correct state  must after
suspend_devices_and_enter(state) ,so push this patch.

Signed-off-by: Li Jun <lijun01@kylinos.cn>
---
  kernel/power/hibernate.c | 3 +++
  1 file changed, 3 insertions(+)

     if (error)
@@ -846,6 +848,7 @@ int hibernate(void)
     hibernate_release();
   Unlock:
     unlock_system_sleep(sleep_flags);
+   pm_suspend_target_state = PM_SUSPEND_ON;
     pr_info("hibernation exit\n");

     return error;
diff mbox series

Patch

diff --git a/kernel/power/hibernate.c b/kernel/power/hibernate.c
index 1f87aa01ba44..c7c0e7c51985 100644
--- a/kernel/power/hibernate.c
+++ b/kernel/power/hibernate.c
@@ -766,6 +766,8 @@  int hibernate(void)
     }

     pr_info("hibernation entry\n");
+   pm_suspend_target_state = PM_SUSPEND_MAX;
+
     pm_prepare_console();
     error = pm_notifier_call_chain_robust(PM_HIBERNATION_PREPARE, 
PM_POST_HIBERNATION);