PM: QoS: Make CPU latency QoS depend on CONFIG_CPU_IDLE
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 11 Feb 2020 23:37:11 +0000 (00:37 +0100)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Fri, 14 Feb 2020 09:37:27 +0000 (10:37 +0100)
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>
include/linux/pm_qos.h
kernel/power/qos.c

index df065db3f57a6b7fdfaa5aafb83baf9d155489ff..4a69d4af3ff8e954c9e15b5879a32ea08d0d980d 100644 (file)
@@ -143,11 +143,24 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf,
                         struct pm_qos_flags_request *req,
                         enum pm_qos_req_action action, s32 val);
 
+#ifdef CONFIG_CPU_IDLE
 s32 cpu_latency_qos_limit(void);
 bool cpu_latency_qos_request_active(struct pm_qos_request *req);
 void cpu_latency_qos_add_request(struct pm_qos_request *req, s32 value);
 void cpu_latency_qos_update_request(struct pm_qos_request *req, s32 new_value);
 void cpu_latency_qos_remove_request(struct pm_qos_request *req);
+#else
+static inline s32 cpu_latency_qos_limit(void) { return INT_MAX; }
+static inline bool cpu_latency_qos_request_active(struct pm_qos_request *req)
+{
+       return false;
+}
+static inline void cpu_latency_qos_add_request(struct pm_qos_request *req,
+                                              s32 value) {}
+static inline void cpu_latency_qos_update_request(struct pm_qos_request *req,
+                                                 s32 new_value) {}
+static inline void cpu_latency_qos_remove_request(struct pm_qos_request *req) {}
+#endif
 
 #ifdef CONFIG_PM
 enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);
index ef73573db43d4ccc926c642208793a16c442f619..32927682bcc400b7b02f2d5fe45af336c287b475 100644 (file)
@@ -209,6 +209,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf,
        return prev_value != curr_value;
 }
 
+#ifdef CONFIG_CPU_IDLE
 /* Definitions related to the CPU latency QoS. */
 
 static struct pm_qos_constraints cpu_latency_constraints = {
@@ -421,6 +422,7 @@ static int __init cpu_latency_qos_init(void)
        return ret;
 }
 late_initcall(cpu_latency_qos_init);
+#endif /* CONFIG_CPU_IDLE */
 
 /* Definitions related to the frequency QoS below. */