diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/disk.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 45e8541ab7e3..432ee575c9ee 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -71,6 +71,14 @@ void hibernation_set_ops(struct platform_hibernation_ops *ops) | |||
71 | mutex_unlock(&pm_mutex); | 71 | mutex_unlock(&pm_mutex); |
72 | } | 72 | } |
73 | 73 | ||
74 | static bool entering_platform_hibernation; | ||
75 | |||
76 | bool system_entering_hibernation(void) | ||
77 | { | ||
78 | return entering_platform_hibernation; | ||
79 | } | ||
80 | EXPORT_SYMBOL(system_entering_hibernation); | ||
81 | |||
74 | #ifdef CONFIG_PM_DEBUG | 82 | #ifdef CONFIG_PM_DEBUG |
75 | static void hibernation_debug_sleep(void) | 83 | static void hibernation_debug_sleep(void) |
76 | { | 84 | { |
@@ -411,6 +419,7 @@ int hibernation_platform_enter(void) | |||
411 | if (error) | 419 | if (error) |
412 | goto Close; | 420 | goto Close; |
413 | 421 | ||
422 | entering_platform_hibernation = true; | ||
414 | suspend_console(); | 423 | suspend_console(); |
415 | error = device_suspend(PMSG_HIBERNATE); | 424 | error = device_suspend(PMSG_HIBERNATE); |
416 | if (error) { | 425 | if (error) { |
@@ -445,6 +454,7 @@ int hibernation_platform_enter(void) | |||
445 | Finish: | 454 | Finish: |
446 | hibernation_ops->finish(); | 455 | hibernation_ops->finish(); |
447 | Resume_devices: | 456 | Resume_devices: |
457 | entering_platform_hibernation = false; | ||
448 | device_resume(PMSG_RESTORE); | 458 | device_resume(PMSG_RESTORE); |
449 | resume_console(); | 459 | resume_console(); |
450 | Close: | 460 | Close: |