diff options
| author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
|---|---|---|
| committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2010-03-05 15:46:18 -0500 |
| commit | 3fa04ecd72780da31ba8b329e148179bc24a9c7d (patch) | |
| tree | f5d462fd4aee086952d18f159f737c450ab46b3b /kernel/power/main.c | |
| parent | 180b62a3d837613fcac3ce89576526423926c3c3 (diff) | |
| parent | 1cda707d52e51a6cafac0aef12d2bd7052d572e6 (diff) | |
Merge branch 'writeback-for-2.6.34' into nfs-for-2.6.34
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 | ||
