diff options
| -rw-r--r-- | include/linux/suspend.h | 2 | ||||
| -rw-r--r-- | kernel/power/process.c | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 6b1712c5110..26697514c5e 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
| @@ -308,6 +308,8 @@ static inline int unregister_pm_notifier(struct notifier_block *nb) | |||
| 308 | } | 308 | } |
| 309 | 309 | ||
| 310 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) | 310 | #define pm_notifier(fn, pri) do { (void)(fn); } while (0) |
| 311 | |||
| 312 | static inline bool pm_check_wakeup_events(void) { return true; } | ||
| 311 | #endif /* !CONFIG_PM_SLEEP */ | 313 | #endif /* !CONFIG_PM_SLEEP */ |
| 312 | 314 | ||
| 313 | extern struct mutex pm_mutex; | 315 | extern struct mutex pm_mutex; |
diff --git a/kernel/power/process.c b/kernel/power/process.c index 028a99598f4..e50b4c1b2a0 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
| @@ -40,6 +40,7 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 40 | struct timeval start, end; | 40 | struct timeval start, end; |
| 41 | u64 elapsed_csecs64; | 41 | u64 elapsed_csecs64; |
| 42 | unsigned int elapsed_csecs; | 42 | unsigned int elapsed_csecs; |
| 43 | bool wakeup = false; | ||
| 43 | 44 | ||
| 44 | do_gettimeofday(&start); | 45 | do_gettimeofday(&start); |
| 45 | 46 | ||
| @@ -78,6 +79,11 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 78 | if (!todo || time_after(jiffies, end_time)) | 79 | if (!todo || time_after(jiffies, end_time)) |
| 79 | break; | 80 | break; |
| 80 | 81 | ||
| 82 | if (!pm_check_wakeup_events()) { | ||
| 83 | wakeup = true; | ||
| 84 | break; | ||
| 85 | } | ||
| 86 | |||
| 81 | /* | 87 | /* |
| 82 | * We need to retry, but first give the freezing tasks some | 88 | * We need to retry, but first give the freezing tasks some |
| 83 | * time to enter the regrigerator. | 89 | * time to enter the regrigerator. |
| @@ -97,8 +103,9 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 97 | * but it cleans up leftover PF_FREEZE requests. | 103 | * but it cleans up leftover PF_FREEZE requests. |
| 98 | */ | 104 | */ |
| 99 | printk("\n"); | 105 | printk("\n"); |
| 100 | printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds " | 106 | printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds " |
| 101 | "(%d tasks refusing to freeze, wq_busy=%d):\n", | 107 | "(%d tasks refusing to freeze, wq_busy=%d):\n", |
| 108 | wakeup ? "aborted" : "failed", | ||
| 102 | elapsed_csecs / 100, elapsed_csecs % 100, | 109 | elapsed_csecs / 100, elapsed_csecs % 100, |
| 103 | todo - wq_busy, wq_busy); | 110 | todo - wq_busy, wq_busy); |
| 104 | 111 | ||
| @@ -107,7 +114,7 @@ static int try_to_freeze_tasks(bool sig_only) | |||
| 107 | read_lock(&tasklist_lock); | 114 | read_lock(&tasklist_lock); |
| 108 | do_each_thread(g, p) { | 115 | do_each_thread(g, p) { |
| 109 | task_lock(p); | 116 | task_lock(p); |
| 110 | if (freezing(p) && !freezer_should_skip(p)) | 117 | if (!wakeup && freezing(p) && !freezer_should_skip(p)) |
| 111 | sched_show_task(p); | 118 | sched_show_task(p); |
| 112 | cancel_freezing(p); | 119 | cancel_freezing(p); |
| 113 | task_unlock(p); | 120 | task_unlock(p); |
