Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Amit Kucheria <amit.kucheria@linaro.org>
Tested-by: Amit Kucheria <amit.kucheria@linaro.org>

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