]> rtime.felk.cvut.cz Git - zynq/linux.git/blobdiff - kernel/power/hibernate.c
Merge branch '4.0.8-rt6'
[zynq/linux.git] / kernel / power / hibernate.c
index 27ba9a5e97ed903e706ee78a181557f5aaed5190..bc2b1708c8dbc665a139a38ab160a3828b850d9e 100644 (file)
@@ -287,6 +287,8 @@ static int create_image(int platform_mode)
 
        local_irq_disable();
 
+       system_state = SYSTEM_SUSPEND;
+
        error = syscore_suspend();
        if (error) {
                printk(KERN_ERR "PM: Some system devices failed to power down, "
@@ -317,6 +319,7 @@ static int create_image(int platform_mode)
 
  Enable_irqs:
        clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
+       system_state = SYSTEM_RUNNING;
        local_irq_enable();
 
  Enable_cpus:
@@ -442,6 +445,7 @@ static int resume_target_kernel(bool platform_mode)
        clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 
        local_irq_disable();
+       system_state = SYSTEM_SUSPEND;
 
        error = syscore_suspend();
        if (error)
@@ -476,6 +480,7 @@ static int resume_target_kernel(bool platform_mode)
 
  Enable_irqs:
        clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
+       system_state = SYSTEM_RUNNING;
        local_irq_enable();
 
  Enable_cpus:
@@ -563,6 +568,7 @@ int hibernation_platform_enter(void)
        clockevents_notify(CLOCK_EVT_NOTIFY_SUSPEND, NULL);
 
        local_irq_disable();
+       system_state = SYSTEM_SUSPEND;
        syscore_suspend();
        if (pm_wakeup_pending()) {
                error = -EAGAIN;
@@ -576,6 +582,7 @@ int hibernation_platform_enter(void)
  Power_up:
        syscore_resume();
        clockevents_notify(CLOCK_EVT_NOTIFY_RESUME, NULL);
+       system_state = SYSTEM_RUNNING;
        local_irq_enable();
        enable_nonboot_cpus();