diff options
Diffstat (limited to 'kernel/power/process.c')
-rw-r--r-- | kernel/power/process.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/kernel/power/process.c b/kernel/power/process.c index 77274c9ba2f1..7e426459e60a 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -143,7 +143,10 @@ int freeze_processes(void) | |||
143 | /** | 143 | /** |
144 | * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator. | 144 | * freeze_kernel_threads - Make freezable kernel threads go to the refrigerator. |
145 | * | 145 | * |
146 | * On success, returns 0. On failure, -errno and system is fully thawed. | 146 | * On success, returns 0. On failure, -errno and only the kernel threads are |
147 | * thawed, so as to give a chance to the caller to do additional cleanups | ||
148 | * (if any) before thawing the userspace tasks. So, it is the responsibility | ||
149 | * of the caller to thaw the userspace tasks, when the time is right. | ||
147 | */ | 150 | */ |
148 | int freeze_kernel_threads(void) | 151 | int freeze_kernel_threads(void) |
149 | { | 152 | { |
@@ -159,7 +162,7 @@ int freeze_kernel_threads(void) | |||
159 | BUG_ON(in_atomic()); | 162 | BUG_ON(in_atomic()); |
160 | 163 | ||
161 | if (error) | 164 | if (error) |
162 | thaw_processes(); | 165 | thaw_kernel_threads(); |
163 | return error; | 166 | return error; |
164 | } | 167 | } |
165 | 168 | ||
@@ -188,3 +191,22 @@ void thaw_processes(void) | |||
188 | printk("done.\n"); | 191 | printk("done.\n"); |
189 | } | 192 | } |
190 | 193 | ||
194 | void thaw_kernel_threads(void) | ||
195 | { | ||
196 | struct task_struct *g, *p; | ||
197 | |||
198 | pm_nosig_freezing = false; | ||
199 | printk("Restarting kernel threads ... "); | ||
200 | |||
201 | thaw_workqueues(); | ||
202 | |||
203 | read_lock(&tasklist_lock); | ||
204 | do_each_thread(g, p) { | ||
205 | if (p->flags & (PF_KTHREAD | PF_WQ_WORKER)) | ||
206 | __thaw_task(p); | ||
207 | } while_each_thread(g, p); | ||
208 | read_unlock(&tasklist_lock); | ||
209 | |||
210 | schedule(); | ||
211 | printk("done.\n"); | ||
212 | } | ||