aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/pm_qos.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:48:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-01 15:48:54 -0400
commit4dedde7c7a18f55180574f934dbc1be84ca0400b (patch)
treed7cc511e8ba8ffceadf3f45b9a63395c4e4183c5 /include/linux/pm_qos.h
parent683b6c6f82a60fabf47012581c2cfbf1b037ab95 (diff)
parent0ecfe310f4517d7505599be738158087c165be7c (diff)
Merge tag 'pm+acpi-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm
Pull ACPI and power management updates from Rafael Wysocki: "The majority of this material spent some time in linux-next, some of it even several weeks. There are a few relatively fresh commits in it, but they are mostly fixes and simple cleanups. ACPI took the lead this time, both in terms of the number of commits and the number of modified lines of code, cpufreq follows and there are a few changes in the PM core and in cpuidle too. A new feature that already got some LWN.net's attention is the device PM QoS extension allowing latency tolerance requirements to be propagated from leaf devices to their ancestors with hardware interfaces for specifying latency tolerance. That should help systems with hardware-driven power management to avoid going too far with it in cases when there are latency tolerance constraints. There also are some significant changes in the ACPI core related to the way in which hotplug notifications are handled. They affect PCI hotplug (ACPIPHP) and the ACPI dock station code too. The bottom line is that all those notification now go through the root notify handler and are propagated to the interested subsystems by means of callbacks instead of having to install a notify handler for each device object that we can potentially get hotplug notifications for. In addition to that ACPICA will now advertise "Windows 2013" compatibility for _OSI, because some systems out there don't work correctly if that is not done (some of them don't even boot). On the system suspend side of things, all of the device suspend and resume callbacks, except for ->prepare() and ->complete(), are now going to be executed asynchronously as that turns out to speed up system suspend and resume on some platforms quite significantly and we have a few more optimizations in that area. Apart from that, there are some new device IDs and fixes and cleanups all over. In particular, the system suspend and resume handling by cpufreq should be improved and the cpuidle menu governor should be a bit more robust now. Specifics: - Device PM QoS support for latency tolerance constraints on systems with hardware interfaces allowing such constraints to be specified. That is necessary to prevent hardware-driven power management from becoming overly aggressive on some systems and to prevent power management features leading to excessive latencies from being used in some cases. - Consolidation of the handling of ACPI hotplug notifications for device objects. This causes all device hotplug notifications to go through the root notify handler (that was executed for all of them anyway before) that propagates them to individual subsystems, if necessary, by executing callbacks provided by those subsystems (those callbacks are associated with struct acpi_device objects during device enumeration). As a result, the code in question becomes both smaller in size and more straightforward and all of those changes should not affect users. - ACPICA update, including fixes related to the handling of _PRT in cases when it is broken and the addition of "Windows 2013" to the list of supported "features" for _OSI (which is necessary to support systems that work incorrectly or don't even boot without it). Changes from Bob Moore and Lv Zheng. - Consolidation of ACPI _OST handling from Jiang Liu. - ACPI battery and AC fixes allowing unusual system configurations to be handled by that code from Alexander Mezin. - New device IDs for the ACPI LPSS driver from Chiau Ee Chew. - ACPI fan and thermal optimizations related to system suspend and resume from Aaron Lu. - Cleanups related to ACPI video from Jean Delvare. - Assorted ACPI fixes and cleanups from Al Stone, Hanjun Guo, Lan Tianyu, Paul Bolle, Tomasz Nowicki. - Intel RAPL (Running Average Power Limits) driver cleanups from Jacob Pan. - intel_pstate fixes and cleanups from Dirk Brandewie. - cpufreq fixes related to system suspend/resume handling from Viresh Kumar. - cpufreq core fixes and cleanups from Viresh Kumar, Stratos Karafotis, Saravana Kannan, Rashika Kheria, Joe Perches. - cpufreq drivers updates from Viresh Kumar, Zhuoyu Zhang, Rob Herring. - cpuidle fixes related to the menu governor from Tuukka Tikkanen. - cpuidle fix related to coupled CPUs handling from Paul Burton. - Asynchronous execution of all device suspend and resume callbacks, except for ->prepare and ->complete, during system suspend and resume from Chuansheng Liu. - Delayed resuming of runtime-suspended devices during system suspend for the PCI bus type and ACPI PM domain. - New set of PM helper routines to allow device runtime PM callbacks to be used during system suspend and resume more easily from Ulf Hansson. - Assorted fixes and cleanups in the PM core from Geert Uytterhoeven, Prabhakar Lad, Philipp Zabel, Rashika Kheria, Sebastian Capella. - devfreq fix from Saravana Kannan" * tag 'pm+acpi-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm: (162 commits) PM / devfreq: Rewrite devfreq_update_status() to fix multiple bugs PM / sleep: Correct whitespace errors in <linux/pm.h> intel_pstate: Set core to min P state during core offline cpufreq: Add stop CPU callback to cpufreq_driver interface cpufreq: Remove unnecessary braces cpufreq: Fix checkpatch errors and warnings cpufreq: powerpc: add cpufreq transition latency for FSL e500mc SoCs MAINTAINERS: Reorder maintainer addresses for PM and ACPI PM / Runtime: Update runtime_idle() documentation for return value meaning video / output: Drop display output class support fujitsu-laptop: Drop unneeded include acer-wmi: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / gpu / drm: Stop selecting VIDEO_OUTPUT_CONTROL ACPI / video: fix ACPI_VIDEO dependencies cpufreq: remove unused notifier: CPUFREQ_{SUSPENDCHANGE|RESUMECHANGE} cpufreq: Do not allow ->setpolicy drivers to provide ->target cpufreq: arm_big_little: set 'physical_cluster' for each CPU cpufreq: arm_big_little: make vexpress driver depend on bL core driver ACPI / button: Add ACPI Button event via netlink routine ACPI: Remove duplicate definitions of PREFIX ...
Diffstat (limited to 'include/linux/pm_qos.h')
-rw-r--r--include/linux/pm_qos.h34
1 files changed, 25 insertions, 9 deletions
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
index 5a95013905c8..9ab4bf7c4646 100644
--- a/include/linux/pm_qos.h
+++ b/include/linux/pm_qos.h
@@ -32,7 +32,10 @@ enum pm_qos_flags_status {
32#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 32#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
33#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC) 33#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
34#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0 34#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
35#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0 35#define PM_QOS_RESUME_LATENCY_DEFAULT_VALUE 0
36#define PM_QOS_LATENCY_TOLERANCE_DEFAULT_VALUE 0
37#define PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT (-1)
38#define PM_QOS_LATENCY_ANY ((s32)(~(__u32)0 >> 1))
36 39
37#define PM_QOS_FLAG_NO_POWER_OFF (1 << 0) 40#define PM_QOS_FLAG_NO_POWER_OFF (1 << 0)
38#define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1) 41#define PM_QOS_FLAG_REMOTE_WAKEUP (1 << 1)
@@ -49,7 +52,8 @@ struct pm_qos_flags_request {
49}; 52};
50 53
51enum dev_pm_qos_req_type { 54enum dev_pm_qos_req_type {
52 DEV_PM_QOS_LATENCY = 1, 55 DEV_PM_QOS_RESUME_LATENCY = 1,
56 DEV_PM_QOS_LATENCY_TOLERANCE,
53 DEV_PM_QOS_FLAGS, 57 DEV_PM_QOS_FLAGS,
54}; 58};
55 59
@@ -77,6 +81,7 @@ struct pm_qos_constraints {
77 struct plist_head list; 81 struct plist_head list;
78 s32 target_value; /* Do not change to 64 bit */ 82 s32 target_value; /* Do not change to 64 bit */
79 s32 default_value; 83 s32 default_value;
84 s32 no_constraint_value;
80 enum pm_qos_type type; 85 enum pm_qos_type type;
81 struct blocking_notifier_head *notifiers; 86 struct blocking_notifier_head *notifiers;
82}; 87};
@@ -87,9 +92,11 @@ struct pm_qos_flags {
87}; 92};
88 93
89struct dev_pm_qos { 94struct dev_pm_qos {
90 struct pm_qos_constraints latency; 95 struct pm_qos_constraints resume_latency;
96 struct pm_qos_constraints latency_tolerance;
91 struct pm_qos_flags flags; 97 struct pm_qos_flags flags;
92 struct dev_pm_qos_request *latency_req; 98 struct dev_pm_qos_request *resume_latency_req;
99 struct dev_pm_qos_request *latency_tolerance_req;
93 struct dev_pm_qos_request *flags_req; 100 struct dev_pm_qos_request *flags_req;
94}; 101};
95 102
@@ -142,7 +149,8 @@ int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
142void dev_pm_qos_constraints_init(struct device *dev); 149void dev_pm_qos_constraints_init(struct device *dev);
143void dev_pm_qos_constraints_destroy(struct device *dev); 150void dev_pm_qos_constraints_destroy(struct device *dev);
144int dev_pm_qos_add_ancestor_request(struct device *dev, 151int dev_pm_qos_add_ancestor_request(struct device *dev,
145 struct dev_pm_qos_request *req, s32 value); 152 struct dev_pm_qos_request *req,
153 enum dev_pm_qos_req_type type, s32 value);
146#else 154#else
147static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, 155static inline enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev,
148 s32 mask) 156 s32 mask)
@@ -185,7 +193,9 @@ static inline void dev_pm_qos_constraints_destroy(struct device *dev)
185 dev->power.power_state = PMSG_INVALID; 193 dev->power.power_state = PMSG_INVALID;
186} 194}
187static inline int dev_pm_qos_add_ancestor_request(struct device *dev, 195static inline int dev_pm_qos_add_ancestor_request(struct device *dev,
188 struct dev_pm_qos_request *req, s32 value) 196 struct dev_pm_qos_request *req,
197 enum dev_pm_qos_req_type type,
198 s32 value)
189 { return 0; } 199 { return 0; }
190#endif 200#endif
191 201
@@ -195,10 +205,12 @@ void dev_pm_qos_hide_latency_limit(struct device *dev);
195int dev_pm_qos_expose_flags(struct device *dev, s32 value); 205int dev_pm_qos_expose_flags(struct device *dev, s32 value);
196void dev_pm_qos_hide_flags(struct device *dev); 206void dev_pm_qos_hide_flags(struct device *dev);
197int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set); 207int dev_pm_qos_update_flags(struct device *dev, s32 mask, bool set);
208s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev);
209int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val);
198 210
199static inline s32 dev_pm_qos_requested_latency(struct device *dev) 211static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev)
200{ 212{
201 return dev->power.qos->latency_req->data.pnode.prio; 213 return dev->power.qos->resume_latency_req->data.pnode.prio;
202} 214}
203 215
204static inline s32 dev_pm_qos_requested_flags(struct device *dev) 216static inline s32 dev_pm_qos_requested_flags(struct device *dev)
@@ -214,8 +226,12 @@ static inline int dev_pm_qos_expose_flags(struct device *dev, s32 value)
214static inline void dev_pm_qos_hide_flags(struct device *dev) {} 226static inline void dev_pm_qos_hide_flags(struct device *dev) {}
215static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set) 227static inline int dev_pm_qos_update_flags(struct device *dev, s32 m, bool set)
216 { return 0; } 228 { return 0; }
229static inline s32 dev_pm_qos_get_user_latency_tolerance(struct device *dev)
230 { return PM_QOS_LATENCY_TOLERANCE_NO_CONSTRAINT; }
231static inline int dev_pm_qos_update_user_latency_tolerance(struct device *dev, s32 val)
232 { return 0; }
217 233
218static inline s32 dev_pm_qos_requested_latency(struct device *dev) { return 0; } 234static inline s32 dev_pm_qos_requested_resume_latency(struct device *dev) { return 0; }
219static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; } 235static inline s32 dev_pm_qos_requested_flags(struct device *dev) { return 0; }
220#endif 236#endif
221 237