diff options
Diffstat (limited to 'kernel/power/user.c')
-rw-r--r-- | kernel/power/user.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/kernel/power/user.c b/kernel/power/user.c index 1f24f30b951b..7f19afe01b48 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -151,10 +151,14 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
151 | if (data->frozen) | 151 | if (data->frozen) |
152 | break; | 152 | break; |
153 | mutex_lock(&pm_mutex); | 153 | mutex_lock(&pm_mutex); |
154 | if (freeze_processes()) { | 154 | error = pm_notifier_call_chain(PM_HIBERNATION_PREPARE); |
155 | thaw_processes(); | 155 | if (!error) { |
156 | error = -EBUSY; | 156 | error = freeze_processes(); |
157 | if (error) | ||
158 | thaw_processes(); | ||
157 | } | 159 | } |
160 | if (error) | ||
161 | pm_notifier_call_chain(PM_POST_HIBERNATION); | ||
158 | mutex_unlock(&pm_mutex); | 162 | mutex_unlock(&pm_mutex); |
159 | if (!error) | 163 | if (!error) |
160 | data->frozen = 1; | 164 | data->frozen = 1; |
@@ -165,6 +169,7 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp, | |||
165 | break; | 169 | break; |
166 | mutex_lock(&pm_mutex); | 170 | mutex_lock(&pm_mutex); |
167 | thaw_processes(); | 171 | thaw_processes(); |
172 | pm_notifier_call_chain(PM_POST_HIBERNATION); | ||
168 | mutex_unlock(&pm_mutex); | 173 | mutex_unlock(&pm_mutex); |
169 | data->frozen = 0; | 174 | data->frozen = 0; |
170 | break; | 175 | break; |