diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:53:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:53:17 -0400 |
| commit | a8cbf22559ceefdcdfac00701e8e6da7518b7e8e (patch) | |
| tree | 63ebd5779a37f809f7daed77dbf27aa3f1e1110c /kernel/power/main.c | |
| parent | e36f561a2c88394ef2708f1ab300fe8a79e9f651 (diff) | |
| parent | 9c034392533f3e9f00656d5c58478cff2560ef81 (diff) | |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: (26 commits)
PM / Wakeup: Show wakeup sources statistics in debugfs
PM: Introduce library for device-specific OPPs (v7)
PM: Add sysfs attr for rechecking dev hash from PM trace
PM: Lock PM device list mutex in show_dev_hash()
PM / Runtime: Remove idle notification after failing suspend
PM / Hibernate: Modify signature used to mark swap
PM / Runtime: Reduce code duplication in core helper functions
PM: Allow wakeup events to abort freezing of tasks
PM: runtime: add missed pm_request_autosuspend
PM / Hibernate: Make some boot messages look less scary
PM / Runtime: Implement autosuspend support
PM / Runtime: Add no_callbacks flag
PM / Runtime: Combine runtime PM entry points
PM / Runtime: Merge synchronous and async runtime routines
PM / Runtime: Replace boolean arguments with bitflags
PM / Runtime: Move code in drivers/base/power/runtime.c
sysfs: Add sysfs_merge_group() and sysfs_unmerge_group()
PM: Fix potential issue with failing asynchronous suspend
PM / Wakeup: Introduce wakeup source objects and event statistics (v3)
PM: Fix signed/unsigned warning in dpm_show_time()
...
Diffstat (limited to 'kernel/power/main.c')
| -rw-r--r-- | kernel/power/main.c | 29 |
1 files changed, 24 insertions, 5 deletions
diff --git a/kernel/power/main.c b/kernel/power/main.c index 62b0bc6e4983..7b5db6a8561e 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -237,18 +237,18 @@ static ssize_t wakeup_count_show(struct kobject *kobj, | |||
| 237 | struct kobj_attribute *attr, | 237 | struct kobj_attribute *attr, |
| 238 | char *buf) | 238 | char *buf) |
| 239 | { | 239 | { |
| 240 | unsigned long val; | 240 | unsigned int val; |
| 241 | 241 | ||
| 242 | return pm_get_wakeup_count(&val) ? sprintf(buf, "%lu\n", val) : -EINTR; | 242 | return pm_get_wakeup_count(&val) ? sprintf(buf, "%u\n", val) : -EINTR; |
| 243 | } | 243 | } |
| 244 | 244 | ||
| 245 | static ssize_t wakeup_count_store(struct kobject *kobj, | 245 | static ssize_t wakeup_count_store(struct kobject *kobj, |
| 246 | struct kobj_attribute *attr, | 246 | struct kobj_attribute *attr, |
| 247 | const char *buf, size_t n) | 247 | const char *buf, size_t n) |
| 248 | { | 248 | { |
| 249 | unsigned long val; | 249 | unsigned int val; |
| 250 | 250 | ||
| 251 | if (sscanf(buf, "%lu", &val) == 1) { | 251 | if (sscanf(buf, "%u", &val) == 1) { |
| 252 | if (pm_save_wakeup_count(val)) | 252 | if (pm_save_wakeup_count(val)) |
| 253 | return n; | 253 | return n; |
| 254 | } | 254 | } |
| @@ -281,12 +281,30 @@ pm_trace_store(struct kobject *kobj, struct kobj_attribute *attr, | |||
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | power_attr(pm_trace); | 283 | power_attr(pm_trace); |
| 284 | |||
| 285 | static ssize_t pm_trace_dev_match_show(struct kobject *kobj, | ||
| 286 | struct kobj_attribute *attr, | ||
| 287 | char *buf) | ||
| 288 | { | ||
| 289 | return show_trace_dev_match(buf, PAGE_SIZE); | ||
| 290 | } | ||
| 291 | |||
| 292 | static ssize_t | ||
| 293 | pm_trace_dev_match_store(struct kobject *kobj, struct kobj_attribute *attr, | ||
| 294 | const char *buf, size_t n) | ||
| 295 | { | ||
| 296 | return -EINVAL; | ||
| 297 | } | ||
| 298 | |||
| 299 | power_attr(pm_trace_dev_match); | ||
| 300 | |||
| 284 | #endif /* CONFIG_PM_TRACE */ | 301 | #endif /* CONFIG_PM_TRACE */ |
| 285 | 302 | ||
| 286 | static struct attribute * g[] = { | 303 | static struct attribute * g[] = { |
| 287 | &state_attr.attr, | 304 | &state_attr.attr, |
| 288 | #ifdef CONFIG_PM_TRACE | 305 | #ifdef CONFIG_PM_TRACE |
| 289 | &pm_trace_attr.attr, | 306 | &pm_trace_attr.attr, |
| 307 | &pm_trace_dev_match_attr.attr, | ||
| 290 | #endif | 308 | #endif |
| 291 | #ifdef CONFIG_PM_SLEEP | 309 | #ifdef CONFIG_PM_SLEEP |
| 292 | &pm_async_attr.attr, | 310 | &pm_async_attr.attr, |
| @@ -308,7 +326,7 @@ EXPORT_SYMBOL_GPL(pm_wq); | |||
| 308 | 326 | ||
| 309 | static int __init pm_start_workqueue(void) | 327 | static int __init pm_start_workqueue(void) |
| 310 | { | 328 | { |
| 311 | pm_wq = create_freezeable_workqueue("pm"); | 329 | pm_wq = alloc_workqueue("pm", WQ_FREEZEABLE, 0); |
| 312 | 330 | ||
| 313 | return pm_wq ? 0 : -ENOMEM; | 331 | return pm_wq ? 0 : -ENOMEM; |
| 314 | } | 332 | } |
| @@ -321,6 +339,7 @@ static int __init pm_init(void) | |||
| 321 | int error = pm_start_workqueue(); | 339 | int error = pm_start_workqueue(); |
| 322 | if (error) | 340 | if (error) |
| 323 | return error; | 341 | return error; |
| 342 | hibernate_image_size_init(); | ||
| 324 | power_kobj = kobject_create_and_add("power", NULL); | 343 | power_kobj = kobject_create_and_add("power", NULL); |
| 325 | if (!power_kobj) | 344 | if (!power_kobj) |
| 326 | return -ENOMEM; | 345 | return -ENOMEM; |
