diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 20:22:53 -0500 | 
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-02-26 20:22:53 -0500 | 
| commit | 06a79b82b2a3e4bebb9a20638ca208c780e9e507 (patch) | |
| tree | 594a11b60ba56d7ae62f8affa4cd61836e70e4b1 /kernel/power/main.c | |
| parent | 4912002fffa377e66c5caefc2c311732a4ad5fb8 (diff) | |
| parent | a9c9b4429df437982d2fbfab1f4b46b01329e9ed (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:
  PM / Hibernate: Fix preallocating of memory
  PM / Hibernate: Remove swsusp.c finally
  PM / Hibernate: Remove trailing space in message
  PM: Allow SCSI devices to suspend/resume asynchronously
  PM: Allow USB devices to suspend/resume asynchronously
  USB: implement non-tree resume ordering constraints for PCI host controllers
  PM: Allow PCI devices to suspend/resume asynchronously
  PM / Hibernate: Swap, remove useless check from swsusp_read()
  PM / Hibernate: Really deprecate deprecated user ioctls
  PM: Allow device drivers to use dpm_wait()
  PM: Start asynchronous resume threads upfront
  PM: Add facility for advanced testing of async suspend/resume
  PM: Add a switch for disabling/enabling asynchronous suspend/resume
  PM: Asynchronous suspend and resume of devices
  PM: Add parent information to timing messages
  PM: Document device power attributes in sysfs
  PM / Runtime: Add sysfs switch for disabling device run-time PM
Diffstat (limited to 'kernel/power/main.c')
| -rw-r--r-- | kernel/power/main.c | 31 | 
1 files changed, 30 insertions, 1 deletions
| diff --git a/kernel/power/main.c b/kernel/power/main.c index 0998c7139053..b58800b21fc0 100644 --- a/kernel/power/main.c +++ b/kernel/power/main.c | |||
| @@ -44,6 +44,32 @@ int pm_notifier_call_chain(unsigned long val) | |||
| 44 | == NOTIFY_BAD) ? -EINVAL : 0; | 44 | == NOTIFY_BAD) ? -EINVAL : 0; | 
| 45 | } | 45 | } | 
| 46 | 46 | ||
| 47 | /* If set, devices may be suspended and resumed asynchronously. */ | ||
| 48 | int pm_async_enabled = 1; | ||
| 49 | |||
| 50 | static ssize_t pm_async_show(struct kobject *kobj, struct kobj_attribute *attr, | ||
| 51 | char *buf) | ||
| 52 | { | ||
| 53 | return sprintf(buf, "%d\n", pm_async_enabled); | ||
| 54 | } | ||
| 55 | |||
| 56 | static ssize_t pm_async_store(struct kobject *kobj, struct kobj_attribute *attr, | ||
| 57 | const char *buf, size_t n) | ||
| 58 | { | ||
| 59 | unsigned long val; | ||
| 60 | |||
| 61 | if (strict_strtoul(buf, 10, &val)) | ||
| 62 | return -EINVAL; | ||
| 63 | |||
| 64 | if (val > 1) | ||
| 65 | return -EINVAL; | ||
| 66 | |||
| 67 | pm_async_enabled = val; | ||
| 68 | return n; | ||
| 69 | } | ||
| 70 | |||
| 71 | power_attr(pm_async); | ||
| 72 | |||
| 47 | #ifdef CONFIG_PM_DEBUG | 73 | #ifdef CONFIG_PM_DEBUG | 
| 48 | int pm_test_level = TEST_NONE; | 74 | int pm_test_level = TEST_NONE; | 
| 49 | 75 | ||
| @@ -208,9 +234,12 @@ static struct attribute * g[] = { | |||
| 208 | #ifdef CONFIG_PM_TRACE | 234 | #ifdef CONFIG_PM_TRACE | 
| 209 | &pm_trace_attr.attr, | 235 | &pm_trace_attr.attr, | 
| 210 | #endif | 236 | #endif | 
| 211 | #if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PM_DEBUG) | 237 | #ifdef CONFIG_PM_SLEEP | 
| 238 | &pm_async_attr.attr, | ||
| 239 | #ifdef CONFIG_PM_DEBUG | ||
| 212 | &pm_test_attr.attr, | 240 | &pm_test_attr.attr, | 
| 213 | #endif | 241 | #endif | 
| 242 | #endif | ||
| 214 | NULL, | 243 | NULL, | 
| 215 | }; | 244 | }; | 
| 216 | 245 | ||
