diff options
Diffstat (limited to 'drivers/base/power/main.c')
-rw-r--r-- | drivers/base/power/main.c | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 9cb845e49334..0113adc310dc 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
29 | #include <linux/async.h> | 29 | #include <linux/async.h> |
30 | #include <linux/suspend.h> | 30 | #include <linux/suspend.h> |
31 | 31 | #include <linux/cpuidle.h> | |
32 | #include "../base.h" | 32 | #include "../base.h" |
33 | #include "power.h" | 33 | #include "power.h" |
34 | 34 | ||
@@ -45,10 +45,10 @@ typedef int (*pm_callback_t)(struct device *); | |||
45 | */ | 45 | */ |
46 | 46 | ||
47 | LIST_HEAD(dpm_list); | 47 | LIST_HEAD(dpm_list); |
48 | LIST_HEAD(dpm_prepared_list); | 48 | static LIST_HEAD(dpm_prepared_list); |
49 | LIST_HEAD(dpm_suspended_list); | 49 | static LIST_HEAD(dpm_suspended_list); |
50 | LIST_HEAD(dpm_late_early_list); | 50 | static LIST_HEAD(dpm_late_early_list); |
51 | LIST_HEAD(dpm_noirq_list); | 51 | static LIST_HEAD(dpm_noirq_list); |
52 | 52 | ||
53 | struct suspend_stats suspend_stats; | 53 | struct suspend_stats suspend_stats; |
54 | static DEFINE_MUTEX(dpm_list_mtx); | 54 | static DEFINE_MUTEX(dpm_list_mtx); |
@@ -166,7 +166,7 @@ static ktime_t initcall_debug_start(struct device *dev) | |||
166 | { | 166 | { |
167 | ktime_t calltime = ktime_set(0, 0); | 167 | ktime_t calltime = ktime_set(0, 0); |
168 | 168 | ||
169 | if (initcall_debug) { | 169 | if (pm_print_times_enabled) { |
170 | pr_info("calling %s+ @ %i, parent: %s\n", | 170 | pr_info("calling %s+ @ %i, parent: %s\n", |
171 | dev_name(dev), task_pid_nr(current), | 171 | dev_name(dev), task_pid_nr(current), |
172 | dev->parent ? dev_name(dev->parent) : "none"); | 172 | dev->parent ? dev_name(dev->parent) : "none"); |
@@ -181,7 +181,7 @@ static void initcall_debug_report(struct device *dev, ktime_t calltime, | |||
181 | { | 181 | { |
182 | ktime_t delta, rettime; | 182 | ktime_t delta, rettime; |
183 | 183 | ||
184 | if (initcall_debug) { | 184 | if (pm_print_times_enabled) { |
185 | rettime = ktime_get(); | 185 | rettime = ktime_get(); |
186 | delta = ktime_sub(rettime, calltime); | 186 | delta = ktime_sub(rettime, calltime); |
187 | pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev), | 187 | pr_info("call %s+ returned %d after %Ld usecs\n", dev_name(dev), |
@@ -467,6 +467,7 @@ static void dpm_resume_noirq(pm_message_t state) | |||
467 | mutex_unlock(&dpm_list_mtx); | 467 | mutex_unlock(&dpm_list_mtx); |
468 | dpm_show_time(starttime, state, "noirq"); | 468 | dpm_show_time(starttime, state, "noirq"); |
469 | resume_device_irqs(); | 469 | resume_device_irqs(); |
470 | cpuidle_resume(); | ||
470 | } | 471 | } |
471 | 472 | ||
472 | /** | 473 | /** |
@@ -867,6 +868,7 @@ static int dpm_suspend_noirq(pm_message_t state) | |||
867 | ktime_t starttime = ktime_get(); | 868 | ktime_t starttime = ktime_get(); |
868 | int error = 0; | 869 | int error = 0; |
869 | 870 | ||
871 | cpuidle_pause(); | ||
870 | suspend_device_irqs(); | 872 | suspend_device_irqs(); |
871 | mutex_lock(&dpm_list_mtx); | 873 | mutex_lock(&dpm_list_mtx); |
872 | while (!list_empty(&dpm_late_early_list)) { | 874 | while (!list_empty(&dpm_late_early_list)) { |
@@ -989,8 +991,16 @@ static int dpm_suspend_late(pm_message_t state) | |||
989 | int dpm_suspend_end(pm_message_t state) | 991 | int dpm_suspend_end(pm_message_t state) |
990 | { | 992 | { |
991 | int error = dpm_suspend_late(state); | 993 | int error = dpm_suspend_late(state); |
994 | if (error) | ||
995 | return error; | ||
996 | |||
997 | error = dpm_suspend_noirq(state); | ||
998 | if (error) { | ||
999 | dpm_resume_early(state); | ||
1000 | return error; | ||
1001 | } | ||
992 | 1002 | ||
993 | return error ? : dpm_suspend_noirq(state); | 1003 | return 0; |
994 | } | 1004 | } |
995 | EXPORT_SYMBOL_GPL(dpm_suspend_end); | 1005 | EXPORT_SYMBOL_GPL(dpm_suspend_end); |
996 | 1006 | ||