|
@@ -20,6 +20,7 @@
|
|
#include <linux/resume-trace.h>
|
|
#include <linux/resume-trace.h>
|
|
#include <linux/freezer.h>
|
|
#include <linux/freezer.h>
|
|
#include <linux/vmstat.h>
|
|
#include <linux/vmstat.h>
|
|
|
|
+#include <linux/syscalls.h>
|
|
|
|
|
|
#include "power.h"
|
|
#include "power.h"
|
|
|
|
|
|
@@ -230,9 +231,14 @@ static int enter_state(suspend_state_t state)
|
|
|
|
|
|
if (!valid_state(state))
|
|
if (!valid_state(state))
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
+
|
|
if (!mutex_trylock(&pm_mutex))
|
|
if (!mutex_trylock(&pm_mutex))
|
|
return -EBUSY;
|
|
return -EBUSY;
|
|
|
|
|
|
|
|
+ printk("Syncing filesystems ... ");
|
|
|
|
+ sys_sync();
|
|
|
|
+ printk("done.\n");
|
|
|
|
+
|
|
pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
|
|
pr_debug("PM: Preparing system for %s sleep\n", pm_states[state]);
|
|
if ((error = suspend_prepare()))
|
|
if ((error = suspend_prepare()))
|
|
goto Unlock;
|
|
goto Unlock;
|