summaryrefslogtreecommitdiff
path: root/kernel/power/power.h
diff options
context:
space:
mode:
authorChris Feng <chris.feng@mediatek.com>2023-12-13 16:32:51 +0800
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-12-15 12:33:39 +0100
commit0c4cae1bc00d31c78858c184ede351baea232bdb (patch)
tree1cc59e97e1bb33cff2c86e44f94ab6fed82974f0 /kernel/power/power.h
parent4ac934b1aaa99e00ca25875d55094a4fe34e212d (diff)
PM: hibernate: Avoid missing wakeup events during hibernation
Wakeup events that occur in the hibernation process's hibernation_platform_enter() cannot wake up the system. Although the current hibernation framework will execute part of the recovery process after a wakeup event occurs, it ultimately performs a shutdown operation because the system does not check the return value of hibernation_platform_enter(). In short, if a wakeup event occurs before putting the system into the final low-power state, it will be missed. To solve this problem, check the return value of hibernation_platform_enter(). When it returns -EAGAIN or -EBUSY (indicate the occurrence of a wakeup event), execute the hibernation recovery process, discard the previously saved image, and ultimately return to the working state. Signed-off-by: Chris Feng <chris.feng@mediatek.com> [ rjw: Rephrase the message printed when going back to the working state ] Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'kernel/power/power.h')
-rw-r--r--kernel/power/power.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/power/power.h b/kernel/power/power.h
index 17fd9aaaf084..8499a39c62f4 100644
--- a/kernel/power/power.h
+++ b/kernel/power/power.h
@@ -175,6 +175,8 @@ extern int swsusp_write(unsigned int flags);
void swsusp_close(void);
#ifdef CONFIG_SUSPEND
extern int swsusp_unmark(void);
+#else
+static inline int swsusp_unmark(void) { return 0; }
#endif
struct __kernel_old_timeval;