History

PM: QoS: Make CPU latency QoS depend on CONFIG_CPU_IDLE

Because cpuidle is the only user of the effective constraint coming from the CPU latency QoS, add #ifdef CONFIG_CPU_IDLE around that code to avoid building it unnecessarily.

Rafael J. Wysocki committed 6 years ago

Commit 814d51f1 parent b8e6e272 files · +15 −0Browse files

Unified · Split

2 files
  1. include/linux/pm_qos.h +13 −0
  2. kernel/power/qos.c +2 −0
include/linux/pm_qos.h+13−0
@@ -143,11 +143,24 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, · 142 unmodified lines
143 struct pm_qos_flags_request *req,143 struct pm_qos_flags_request *req,
144 enum pm_qos_req_action action, s32 val);144 enum pm_qos_req_action action, s32 val);
145 145
146#ifdef CONFIG_CPU_IDLE
146s32 cpu_latency_qos_limit(void);147s32 cpu_latency_qos_limit(void);
147bool cpu_latency_qos_request_active(struct pm_qos_request *req);148bool cpu_latency_qos_request_active(struct pm_qos_request *req);
148void cpu_latency_qos_add_request(struct pm_qos_request *req, s32 value);149void cpu_latency_qos_add_request(struct pm_qos_request *req, s32 value);
149void cpu_latency_qos_update_request(struct pm_qos_request *req, s32 new_value);150void cpu_latency_qos_update_request(struct pm_qos_request *req, s32 new_value);
150void cpu_latency_qos_remove_request(struct pm_qos_request *req);151void cpu_latency_qos_remove_request(struct pm_qos_request *req);
152#else
153static inline s32 cpu_latency_qos_limit(void) { return INT_MAX; }
154static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req)
155{
156 return false;
157}
158static inline void cpu_latency_qos_add_request(struct pm_qos_request *req,
159 s32 value) {}
160static inline void cpu_latency_qos_update_request(struct pm_qos_request *req,
161 s32 new_value) {}
162static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req) {}
163#endif
151 164
152#ifdef CONFIG_PM165#ifdef CONFIG_PM
153enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);166enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);
kernel/power/qos.c+2−0
@@ -209,6 +209,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf, · 208 unmodified lines
209 return prev_value != curr_value;209 return prev_value != curr_value;
210}210}
211 211
212#ifdef CONFIG_CPU_IDLE
212/* Definitions related to the CPU latency QoS. */213/* Definitions related to the CPU latency QoS. */
213 214
214static struct pm_qos_constraints cpu_latency_constraints = {215static struct pm_qos_constraints cpu_latency_constraints = {
@@ -421,6 +422,7 @@ static int __init cpu_latency_qos_init(void) · 206 unmodified lines
421 return ret;422 return ret;
422}423}
423late_initcall(cpu_latency_qos_init);424late_initcall(cpu_latency_qos_init);
425#endif /* CONFIG_CPU_IDLE */
424 426
425/* Definitions related to the frequency QoS below. */427/* Definitions related to the frequency QoS below. */
426 428