diff options
| author | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-04-10 06:01:59 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-04-10 06:01:59 -0400 |
| commit | be770021011f00bd6220c87876292053221ca5f1 (patch) | |
| tree | 004a568289a595082119064edf07503170153c19 /drivers/base | |
| parent | e5e02de0665ef2477e7a018193051387c6fe0fbc (diff) | |
| parent | f321c9cbf3bbf86f6e6153419eaf93ad085e3d74 (diff) | |
Merge back earlier suspend/hibernate material for v4.1.
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/power/main.c | 20 | ||||
| -rw-r--r-- | drivers/base/power/trace.c | 6 |
2 files changed, 19 insertions, 7 deletions
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 9717d5f20139..3d874eca7104 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
| @@ -23,7 +23,7 @@ | |||
| 23 | #include <linux/mutex.h> | 23 | #include <linux/mutex.h> |
| 24 | #include <linux/pm.h> | 24 | #include <linux/pm.h> |
| 25 | #include <linux/pm_runtime.h> | 25 | #include <linux/pm_runtime.h> |
| 26 | #include <linux/resume-trace.h> | 26 | #include <linux/pm-trace.h> |
| 27 | #include <linux/interrupt.h> | 27 | #include <linux/interrupt.h> |
| 28 | #include <linux/sched.h> | 28 | #include <linux/sched.h> |
| 29 | #include <linux/async.h> | 29 | #include <linux/async.h> |
| @@ -1017,6 +1017,9 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a | |||
| 1017 | char *info = NULL; | 1017 | char *info = NULL; |
| 1018 | int error = 0; | 1018 | int error = 0; |
| 1019 | 1019 | ||
| 1020 | TRACE_DEVICE(dev); | ||
| 1021 | TRACE_SUSPEND(0); | ||
| 1022 | |||
| 1020 | if (async_error) | 1023 | if (async_error) |
| 1021 | goto Complete; | 1024 | goto Complete; |
| 1022 | 1025 | ||
| @@ -1057,6 +1060,7 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool a | |||
| 1057 | 1060 | ||
| 1058 | Complete: | 1061 | Complete: |
| 1059 | complete_all(&dev->power.completion); | 1062 | complete_all(&dev->power.completion); |
| 1063 | TRACE_SUSPEND(error); | ||
| 1060 | return error; | 1064 | return error; |
| 1061 | } | 1065 | } |
| 1062 | 1066 | ||
| @@ -1078,7 +1082,7 @@ static int device_suspend_noirq(struct device *dev) | |||
| 1078 | { | 1082 | { |
| 1079 | reinit_completion(&dev->power.completion); | 1083 | reinit_completion(&dev->power.completion); |
| 1080 | 1084 | ||
| 1081 | if (pm_async_enabled && dev->power.async_suspend) { | 1085 | if (is_async(dev)) { |
| 1082 | get_device(dev); | 1086 | get_device(dev); |
| 1083 | async_schedule(async_suspend_noirq, dev); | 1087 | async_schedule(async_suspend_noirq, dev); |
| 1084 | return 0; | 1088 | return 0; |
| @@ -1157,6 +1161,9 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as | |||
| 1157 | char *info = NULL; | 1161 | char *info = NULL; |
| 1158 | int error = 0; | 1162 | int error = 0; |
| 1159 | 1163 | ||
| 1164 | TRACE_DEVICE(dev); | ||
| 1165 | TRACE_SUSPEND(0); | ||
| 1166 | |||
| 1160 | __pm_runtime_disable(dev, false); | 1167 | __pm_runtime_disable(dev, false); |
| 1161 | 1168 | ||
| 1162 | if (async_error) | 1169 | if (async_error) |
| @@ -1198,6 +1205,7 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool as | |||
| 1198 | async_error = error; | 1205 | async_error = error; |
| 1199 | 1206 | ||
| 1200 | Complete: | 1207 | Complete: |
| 1208 | TRACE_SUSPEND(error); | ||
| 1201 | complete_all(&dev->power.completion); | 1209 | complete_all(&dev->power.completion); |
| 1202 | return error; | 1210 | return error; |
| 1203 | } | 1211 | } |
| @@ -1219,7 +1227,7 @@ static int device_suspend_late(struct device *dev) | |||
| 1219 | { | 1227 | { |
| 1220 | reinit_completion(&dev->power.completion); | 1228 | reinit_completion(&dev->power.completion); |
| 1221 | 1229 | ||
| 1222 | if (pm_async_enabled && dev->power.async_suspend) { | 1230 | if (is_async(dev)) { |
| 1223 | get_device(dev); | 1231 | get_device(dev); |
| 1224 | async_schedule(async_suspend_late, dev); | 1232 | async_schedule(async_suspend_late, dev); |
| 1225 | return 0; | 1233 | return 0; |
| @@ -1338,6 +1346,9 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
| 1338 | int error = 0; | 1346 | int error = 0; |
| 1339 | DECLARE_DPM_WATCHDOG_ON_STACK(wd); | 1347 | DECLARE_DPM_WATCHDOG_ON_STACK(wd); |
| 1340 | 1348 | ||
| 1349 | TRACE_DEVICE(dev); | ||
| 1350 | TRACE_SUSPEND(0); | ||
| 1351 | |||
| 1341 | dpm_wait_for_children(dev, async); | 1352 | dpm_wait_for_children(dev, async); |
| 1342 | 1353 | ||
| 1343 | if (async_error) | 1354 | if (async_error) |
| @@ -1444,6 +1455,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async) | |||
| 1444 | if (error) | 1455 | if (error) |
| 1445 | async_error = error; | 1456 | async_error = error; |
| 1446 | 1457 | ||
| 1458 | TRACE_SUSPEND(error); | ||
| 1447 | return error; | 1459 | return error; |
| 1448 | } | 1460 | } |
| 1449 | 1461 | ||
| @@ -1465,7 +1477,7 @@ static int device_suspend(struct device *dev) | |||
| 1465 | { | 1477 | { |
| 1466 | reinit_completion(&dev->power.completion); | 1478 | reinit_completion(&dev->power.completion); |
| 1467 | 1479 | ||
| 1468 | if (pm_async_enabled && dev->power.async_suspend) { | 1480 | if (is_async(dev)) { |
| 1469 | get_device(dev); | 1481 | get_device(dev); |
| 1470 | async_schedule(async_suspend, dev); | 1482 | async_schedule(async_suspend, dev); |
| 1471 | return 0; | 1483 | return 0; |
diff --git a/drivers/base/power/trace.c b/drivers/base/power/trace.c index d94a1f5121cf..a311cfa4c5bd 100644 --- a/drivers/base/power/trace.c +++ b/drivers/base/power/trace.c | |||
| @@ -7,7 +7,7 @@ | |||
| 7 | * devices may be working. | 7 | * devices may be working. |
| 8 | */ | 8 | */ |
| 9 | 9 | ||
| 10 | #include <linux/resume-trace.h> | 10 | #include <linux/pm-trace.h> |
| 11 | #include <linux/export.h> | 11 | #include <linux/export.h> |
| 12 | #include <linux/rtc.h> | 12 | #include <linux/rtc.h> |
| 13 | 13 | ||
| @@ -154,7 +154,7 @@ EXPORT_SYMBOL(set_trace_device); | |||
| 154 | * it's not any guarantee, but it's a high _likelihood_ that | 154 | * it's not any guarantee, but it's a high _likelihood_ that |
| 155 | * the match is valid). | 155 | * the match is valid). |
| 156 | */ | 156 | */ |
| 157 | void generate_resume_trace(const void *tracedata, unsigned int user) | 157 | void generate_pm_trace(const void *tracedata, unsigned int user) |
| 158 | { | 158 | { |
| 159 | unsigned short lineno = *(unsigned short *)tracedata; | 159 | unsigned short lineno = *(unsigned short *)tracedata; |
| 160 | const char *file = *(const char **)(tracedata + 2); | 160 | const char *file = *(const char **)(tracedata + 2); |
| @@ -164,7 +164,7 @@ void generate_resume_trace(const void *tracedata, unsigned int user) | |||
| 164 | file_hash_value = hash_string(lineno, file, FILEHASH); | 164 | file_hash_value = hash_string(lineno, file, FILEHASH); |
| 165 | set_magic_time(user_hash_value, file_hash_value, dev_hash_value); | 165 | set_magic_time(user_hash_value, file_hash_value, dev_hash_value); |
| 166 | } | 166 | } |
| 167 | EXPORT_SYMBOL(generate_resume_trace); | 167 | EXPORT_SYMBOL(generate_pm_trace); |
| 168 | 168 | ||
| 169 | extern char __tracedata_start, __tracedata_end; | 169 | extern char __tracedata_start, __tracedata_end; |
| 170 | static int show_file_hash(unsigned int value) | 170 | static int show_file_hash(unsigned int value) |
