Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82398
b: refs/heads/master
c: 5a0a2f3
h: refs/heads/master
v: v3
  • Loading branch information
Rafael J. Wysocki authored and Len Brown committed Feb 1, 2008
1 parent 7c86821 commit 340da91
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: af258f516b3e4e214121f5d6d53cab32ce0d8010
refs/heads/master: 5a0a2f304612bd63948177fef05987f4bcaddcaf
17 changes: 7 additions & 10 deletions trunk/kernel/power/disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,13 @@ static void power_down(void)
while(1);
}

static void unprepare_processes(void)
{
thaw_processes();
pm_restore_console();
}

static int prepare_processes(void)
{
int error = 0;

pm_prepare_console();
if (freeze_processes()) {
error = -EBUSY;
unprepare_processes();
thaw_processes();
}
return error;
}
Expand All @@ -491,6 +484,7 @@ int hibernate(void)
goto Unlock;
}

pm_prepare_console();
error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
if (error)
goto Exit;
Expand Down Expand Up @@ -530,11 +524,12 @@ int hibernate(void)
swsusp_free();
}
Thaw:
unprepare_processes();
thaw_processes();
Finish:
free_basic_memory_bitmaps();
Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION);
pm_restore_console();
atomic_inc(&snapshot_device_available);
Unlock:
mutex_unlock(&pm_mutex);
Expand Down Expand Up @@ -603,6 +598,7 @@ static int software_resume(void)
goto Unlock;
}

pm_prepare_console();
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
if (error)
goto Finish;
Expand All @@ -626,11 +622,12 @@ static int software_resume(void)

printk(KERN_ERR "PM: Restore failed, recovering.\n");
swsusp_free();
unprepare_processes();
thaw_processes();
Done:
free_basic_memory_bitmaps();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
pm_restore_console();
atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */
Unlock:
Expand Down

0 comments on commit 340da91

Please sign in to comment.