diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-22 16:36:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-22 16:36:52 -0400 |
commit | 7100e505b76b4e2efd88b2459d1a932214e29f8a (patch) | |
tree | a8eae8687dc1511c89463b1eb93c8349a7471ab3 /include | |
parent | cb47c1831fa406c964468b259f2082c16cc3f757 (diff) | |
parent | 75a4161a58dd157a2bd2dc8e9986e45b62ac46cf (diff) |
Merge tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull power management updates from Rafael Wysocki:
- ACPI conversion to PM handling based on struct dev_pm_ops.
- Conversion of a number of platform drivers to PM handling based on
struct dev_pm_ops and removal of empty legacy PM callbacks from a
couple of PCI drivers.
- Suspend-to-both for in-kernel hibernation from Bojan Smojver.
- cpuidle fixes and cleanups from ShuoX Liu, Daniel Lezcano and Preeti
Murthy.
- cpufreq bug fixes from Jonghwa Lee and Stephen Boyd.
- Suspend and hibernate fixes from Srivatsa Bhat and Colin Cross.
- Generic PM domains framework updates.
- RTC CMOS wakeup signaling update from Paul Fox.
- sparse warnings fixes from Sachin Kamat.
- Build warnings fixes for the generic PM domains framework and PM
sysfs code.
- sysfs switch for printing device suspend times from Sameer Nanda.
- Documentation fix from Oskar Schirmer.
* tag 'pm-for-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (70 commits)
cpufreq: Fix sysfs deadlock with concurrent hotplug/frequency switch
EXYNOS: bugfix on retrieving old_index from freqs.old
PM / Sleep: call early resume handlers when suspend_noirq fails
PM / QoS: Use NULL pointer instead of plain integer in qos.c
PM / QoS: Use NULL pointer instead of plain integer in pm_qos.h
PM / Sleep: Require CAP_BLOCK_SUSPEND to use wake_lock/wake_unlock
PM / Sleep: Add missing static storage class specifiers in main.c
cpuilde / ACPI: remove time from acpi_processor_cx structure
cpuidle / ACPI: remove usage from acpi_processor_cx structure
cpuidle / ACPI : remove latency_ticks from acpi_processor_cx structure
rtc-cmos: report wakeups from interrupt handler
PM / Sleep: Fix build warning in sysfs.c for CONFIG_PM_SLEEP unset
PM / Domains: Fix build warning for CONFIG_PM_RUNTIME unset
olpc-xo15-sci: Use struct dev_pm_ops for power management
PM / Domains: Replace plain integer with NULL pointer in domain.c file
PM / Domains: Add missing static storage class specifier in domain.c file
PM / crypto / ux500: Use struct dev_pm_ops for power management
PM / IPMI: Remove empty legacy PCI PM callbacks
tpm_nsc: Use struct dev_pm_ops for power management
tpm_tis: Use struct dev_pm_ops for power management
...
Diffstat (limited to 'include')
-rw-r--r-- | include/acpi/acpi_bus.h | 5 | ||||
-rw-r--r-- | include/acpi/processor.h | 7 | ||||
-rw-r--r-- | include/linux/cpuidle.h | 20 | ||||
-rw-r--r-- | include/linux/pm_domain.h | 18 | ||||
-rw-r--r-- | include/linux/pm_qos.h | 2 | ||||
-rw-r--r-- | include/linux/suspend.h | 6 |
6 files changed, 38 insertions, 20 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index 9e6e1c6eb60a..18fd41033e03 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h | |||
@@ -117,9 +117,6 @@ struct acpi_device; | |||
117 | typedef int (*acpi_op_add) (struct acpi_device * device); | 117 | typedef int (*acpi_op_add) (struct acpi_device * device); |
118 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); | 118 | typedef int (*acpi_op_remove) (struct acpi_device * device, int type); |
119 | typedef int (*acpi_op_start) (struct acpi_device * device); | 119 | typedef int (*acpi_op_start) (struct acpi_device * device); |
120 | typedef int (*acpi_op_suspend) (struct acpi_device * device, | ||
121 | pm_message_t state); | ||
122 | typedef int (*acpi_op_resume) (struct acpi_device * device); | ||
123 | typedef int (*acpi_op_bind) (struct acpi_device * device); | 120 | typedef int (*acpi_op_bind) (struct acpi_device * device); |
124 | typedef int (*acpi_op_unbind) (struct acpi_device * device); | 121 | typedef int (*acpi_op_unbind) (struct acpi_device * device); |
125 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); | 122 | typedef void (*acpi_op_notify) (struct acpi_device * device, u32 event); |
@@ -133,8 +130,6 @@ struct acpi_device_ops { | |||
133 | acpi_op_add add; | 130 | acpi_op_add add; |
134 | acpi_op_remove remove; | 131 | acpi_op_remove remove; |
135 | acpi_op_start start; | 132 | acpi_op_start start; |
136 | acpi_op_suspend suspend; | ||
137 | acpi_op_resume resume; | ||
138 | acpi_op_bind bind; | 133 | acpi_op_bind bind; |
139 | acpi_op_unbind unbind; | 134 | acpi_op_unbind unbind; |
140 | acpi_op_notify notify; | 135 | acpi_op_notify notify; |
diff --git a/include/acpi/processor.h b/include/acpi/processor.h index 9d650476d5dc..64ec644808bc 100644 --- a/include/acpi/processor.h +++ b/include/acpi/processor.h | |||
@@ -59,10 +59,7 @@ struct acpi_processor_cx { | |||
59 | u8 entry_method; | 59 | u8 entry_method; |
60 | u8 index; | 60 | u8 index; |
61 | u32 latency; | 61 | u32 latency; |
62 | u32 latency_ticks; | ||
63 | u32 power; | 62 | u32 power; |
64 | u32 usage; | ||
65 | u64 time; | ||
66 | u8 bm_sts_skip; | 63 | u8 bm_sts_skip; |
67 | char desc[ACPI_CX_DESC_LEN]; | 64 | char desc[ACPI_CX_DESC_LEN]; |
68 | }; | 65 | }; |
@@ -334,8 +331,8 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr); | |||
334 | int acpi_processor_hotplug(struct acpi_processor *pr); | 331 | int acpi_processor_hotplug(struct acpi_processor *pr); |
335 | int acpi_processor_power_exit(struct acpi_processor *pr, | 332 | int acpi_processor_power_exit(struct acpi_processor *pr, |
336 | struct acpi_device *device); | 333 | struct acpi_device *device); |
337 | int acpi_processor_suspend(struct acpi_device * device, pm_message_t state); | 334 | int acpi_processor_suspend(struct device *dev); |
338 | int acpi_processor_resume(struct acpi_device * device); | 335 | int acpi_processor_resume(struct device *dev); |
339 | extern struct cpuidle_driver acpi_idle_driver; | 336 | extern struct cpuidle_driver acpi_idle_driver; |
340 | 337 | ||
341 | /* in processor_thermal.c */ | 338 | /* in processor_thermal.c */ |
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 6c26a3da0e03..89dcd30ac8ea 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h | |||
@@ -34,6 +34,7 @@ struct cpuidle_driver; | |||
34 | struct cpuidle_state_usage { | 34 | struct cpuidle_state_usage { |
35 | void *driver_data; | 35 | void *driver_data; |
36 | 36 | ||
37 | unsigned long long disable; | ||
37 | unsigned long long usage; | 38 | unsigned long long usage; |
38 | unsigned long long time; /* in US */ | 39 | unsigned long long time; /* in US */ |
39 | }; | 40 | }; |
@@ -46,7 +47,7 @@ struct cpuidle_state { | |||
46 | unsigned int exit_latency; /* in US */ | 47 | unsigned int exit_latency; /* in US */ |
47 | int power_usage; /* in mW */ | 48 | int power_usage; /* in mW */ |
48 | unsigned int target_residency; /* in US */ | 49 | unsigned int target_residency; /* in US */ |
49 | unsigned int disable; | 50 | bool disabled; /* disabled on all CPUs */ |
50 | 51 | ||
51 | int (*enter) (struct cpuidle_device *dev, | 52 | int (*enter) (struct cpuidle_device *dev, |
52 | struct cpuidle_driver *drv, | 53 | struct cpuidle_driver *drv, |
@@ -136,13 +137,17 @@ struct cpuidle_driver { | |||
136 | extern void disable_cpuidle(void); | 137 | extern void disable_cpuidle(void); |
137 | extern int cpuidle_idle_call(void); | 138 | extern int cpuidle_idle_call(void); |
138 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); | 139 | extern int cpuidle_register_driver(struct cpuidle_driver *drv); |
139 | struct cpuidle_driver *cpuidle_get_driver(void); | 140 | extern struct cpuidle_driver *cpuidle_get_driver(void); |
141 | extern struct cpuidle_driver *cpuidle_driver_ref(void); | ||
142 | extern void cpuidle_driver_unref(void); | ||
140 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); | 143 | extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); |
141 | extern int cpuidle_register_device(struct cpuidle_device *dev); | 144 | extern int cpuidle_register_device(struct cpuidle_device *dev); |
142 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); | 145 | extern void cpuidle_unregister_device(struct cpuidle_device *dev); |
143 | 146 | ||
144 | extern void cpuidle_pause_and_lock(void); | 147 | extern void cpuidle_pause_and_lock(void); |
145 | extern void cpuidle_resume_and_unlock(void); | 148 | extern void cpuidle_resume_and_unlock(void); |
149 | extern void cpuidle_pause(void); | ||
150 | extern void cpuidle_resume(void); | ||
146 | extern int cpuidle_enable_device(struct cpuidle_device *dev); | 151 | extern int cpuidle_enable_device(struct cpuidle_device *dev); |
147 | extern void cpuidle_disable_device(struct cpuidle_device *dev); | 152 | extern void cpuidle_disable_device(struct cpuidle_device *dev); |
148 | extern int cpuidle_wrap_enter(struct cpuidle_device *dev, | 153 | extern int cpuidle_wrap_enter(struct cpuidle_device *dev, |
@@ -157,6 +162,8 @@ static inline int cpuidle_idle_call(void) { return -ENODEV; } | |||
157 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) | 162 | static inline int cpuidle_register_driver(struct cpuidle_driver *drv) |
158 | {return -ENODEV; } | 163 | {return -ENODEV; } |
159 | static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } | 164 | static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; } |
165 | static inline struct cpuidle_driver *cpuidle_driver_ref(void) {return NULL; } | ||
166 | static inline void cpuidle_driver_unref(void) {} | ||
160 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } | 167 | static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } |
161 | static inline int cpuidle_register_device(struct cpuidle_device *dev) | 168 | static inline int cpuidle_register_device(struct cpuidle_device *dev) |
162 | {return -ENODEV; } | 169 | {return -ENODEV; } |
@@ -164,6 +171,8 @@ static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } | |||
164 | 171 | ||
165 | static inline void cpuidle_pause_and_lock(void) { } | 172 | static inline void cpuidle_pause_and_lock(void) { } |
166 | static inline void cpuidle_resume_and_unlock(void) { } | 173 | static inline void cpuidle_resume_and_unlock(void) { } |
174 | static inline void cpuidle_pause(void) { } | ||
175 | static inline void cpuidle_resume(void) { } | ||
167 | static inline int cpuidle_enable_device(struct cpuidle_device *dev) | 176 | static inline int cpuidle_enable_device(struct cpuidle_device *dev) |
168 | {return -ENODEV; } | 177 | {return -ENODEV; } |
169 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } | 178 | static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } |
@@ -202,14 +211,7 @@ struct cpuidle_governor { | |||
202 | extern int cpuidle_register_governor(struct cpuidle_governor *gov); | 211 | extern int cpuidle_register_governor(struct cpuidle_governor *gov); |
203 | extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); | 212 | extern void cpuidle_unregister_governor(struct cpuidle_governor *gov); |
204 | 213 | ||
205 | #ifdef CONFIG_INTEL_IDLE | ||
206 | extern int intel_idle_cpu_init(int cpu); | ||
207 | #else | 214 | #else |
208 | static inline int intel_idle_cpu_init(int cpu) { return -1; } | ||
209 | #endif | ||
210 | |||
211 | #else | ||
212 | static inline int intel_idle_cpu_init(int cpu) { return -1; } | ||
213 | 215 | ||
214 | static inline int cpuidle_register_governor(struct cpuidle_governor *gov) | 216 | static inline int cpuidle_register_governor(struct cpuidle_governor *gov) |
215 | {return 0;} | 217 | {return 0;} |
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h index 30f794eb3826..a7d6172922d4 100644 --- a/include/linux/pm_domain.h +++ b/include/linux/pm_domain.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/err.h> | 15 | #include <linux/err.h> |
16 | #include <linux/of.h> | 16 | #include <linux/of.h> |
17 | #include <linux/notifier.h> | 17 | #include <linux/notifier.h> |
18 | #include <linux/cpuidle.h> | ||
18 | 19 | ||
19 | enum gpd_status { | 20 | enum gpd_status { |
20 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ | 21 | GPD_STATE_ACTIVE = 0, /* PM domain is active */ |
@@ -45,6 +46,11 @@ struct gpd_dev_ops { | |||
45 | bool (*active_wakeup)(struct device *dev); | 46 | bool (*active_wakeup)(struct device *dev); |
46 | }; | 47 | }; |
47 | 48 | ||
49 | struct gpd_cpu_data { | ||
50 | unsigned int saved_exit_latency; | ||
51 | struct cpuidle_state *idle_state; | ||
52 | }; | ||
53 | |||
48 | struct generic_pm_domain { | 54 | struct generic_pm_domain { |
49 | struct dev_pm_domain domain; /* PM domain operations */ | 55 | struct dev_pm_domain domain; /* PM domain operations */ |
50 | struct list_head gpd_list_node; /* Node in the global PM domains list */ | 56 | struct list_head gpd_list_node; /* Node in the global PM domains list */ |
@@ -75,6 +81,7 @@ struct generic_pm_domain { | |||
75 | bool max_off_time_changed; | 81 | bool max_off_time_changed; |
76 | bool cached_power_down_ok; | 82 | bool cached_power_down_ok; |
77 | struct device_node *of_node; /* Node in device tree */ | 83 | struct device_node *of_node; /* Node in device tree */ |
84 | struct gpd_cpu_data *cpu_data; | ||
78 | }; | 85 | }; |
79 | 86 | ||
80 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) | 87 | static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd) |
@@ -105,6 +112,7 @@ struct generic_pm_domain_data { | |||
105 | struct gpd_timing_data td; | 112 | struct gpd_timing_data td; |
106 | struct notifier_block nb; | 113 | struct notifier_block nb; |
107 | struct mutex lock; | 114 | struct mutex lock; |
115 | unsigned int refcount; | ||
108 | bool need_restore; | 116 | bool need_restore; |
109 | bool always_on; | 117 | bool always_on; |
110 | }; | 118 | }; |
@@ -155,6 +163,8 @@ extern int pm_genpd_add_callbacks(struct device *dev, | |||
155 | struct gpd_dev_ops *ops, | 163 | struct gpd_dev_ops *ops, |
156 | struct gpd_timing_data *td); | 164 | struct gpd_timing_data *td); |
157 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); | 165 | extern int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td); |
166 | extern int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int state); | ||
167 | extern int genpd_detach_cpuidle(struct generic_pm_domain *genpd); | ||
158 | extern void pm_genpd_init(struct generic_pm_domain *genpd, | 168 | extern void pm_genpd_init(struct generic_pm_domain *genpd, |
159 | struct dev_power_governor *gov, bool is_off); | 169 | struct dev_power_governor *gov, bool is_off); |
160 | 170 | ||
@@ -211,6 +221,14 @@ static inline int __pm_genpd_remove_callbacks(struct device *dev, bool clear_td) | |||
211 | { | 221 | { |
212 | return -ENOSYS; | 222 | return -ENOSYS; |
213 | } | 223 | } |
224 | static inline int genpd_attach_cpuidle(struct generic_pm_domain *genpd, int st) | ||
225 | { | ||
226 | return -ENOSYS; | ||
227 | } | ||
228 | static inline int genpd_detach_cpuidle(struct generic_pm_domain *genpd) | ||
229 | { | ||
230 | return -ENOSYS; | ||
231 | } | ||
214 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, | 232 | static inline void pm_genpd_init(struct generic_pm_domain *genpd, |
215 | struct dev_power_governor *gov, bool is_off) | 233 | struct dev_power_governor *gov, bool is_off) |
216 | { | 234 | { |
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h index 233149cb19f4..9924ea1f22e0 100644 --- a/include/linux/pm_qos.h +++ b/include/linux/pm_qos.h | |||
@@ -66,7 +66,7 @@ enum pm_qos_req_action { | |||
66 | 66 | ||
67 | static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) | 67 | static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req) |
68 | { | 68 | { |
69 | return req->dev != 0; | 69 | return req->dev != NULL; |
70 | } | 70 | } |
71 | 71 | ||
72 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, | 72 | int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node, |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index cd83059fb592..0c808d7fa579 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -408,6 +408,12 @@ static inline void unlock_system_sleep(void) {} | |||
408 | 408 | ||
409 | #endif /* !CONFIG_PM_SLEEP */ | 409 | #endif /* !CONFIG_PM_SLEEP */ |
410 | 410 | ||
411 | #ifdef CONFIG_PM_SLEEP_DEBUG | ||
412 | extern bool pm_print_times_enabled; | ||
413 | #else | ||
414 | #define pm_print_times_enabled (false) | ||
415 | #endif | ||
416 | |||
411 | #ifdef CONFIG_PM_AUTOSLEEP | 417 | #ifdef CONFIG_PM_AUTOSLEEP |
412 | 418 | ||
413 | /* kernel/power/autosleep.c */ | 419 | /* kernel/power/autosleep.c */ |