Following the recent change in the suspend code path, switch consoles before
calling PM notifiers during hibernation.
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Len Brown <len.brown@intel.com>
-static void unprepare_processes(void)
-{
- thaw_processes();
- pm_restore_console();
-}
-
static int prepare_processes(void)
{
int error = 0;
static int prepare_processes(void)
{
int error = 0;
if (freeze_processes()) {
error = -EBUSY;
if (freeze_processes()) {
error = -EBUSY;
error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
if (error)
goto Exit;
error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE);
if (error)
goto Exit;
Finish:
free_basic_memory_bitmaps();
Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION);
Finish:
free_basic_memory_bitmaps();
Exit:
pm_notifier_call_chain(PM_POST_HIBERNATION);
atomic_inc(&snapshot_device_available);
Unlock:
mutex_unlock(&pm_mutex);
atomic_inc(&snapshot_device_available);
Unlock:
mutex_unlock(&pm_mutex);
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
if (error)
goto Finish;
error = pm_notifier_call_chain(PM_RESTORE_PREPARE);
if (error)
goto Finish;
printk(KERN_ERR "PM: Restore failed, recovering.\n");
swsusp_free();
printk(KERN_ERR "PM: Restore failed, recovering.\n");
swsusp_free();
Done:
free_basic_memory_bitmaps();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
Done:
free_basic_memory_bitmaps();
Finish:
pm_notifier_call_chain(PM_POST_RESTORE);
atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */
Unlock:
atomic_inc(&snapshot_device_available);
/* For success case, the suspend path will release the lock */
Unlock: