Skip to content

Commit 814d51f

Browse files
committed
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 <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Reviewed-by: Amit Kucheria <[email protected]> Tested-by: Amit Kucheria <[email protected]>
1 parent b8e6e27 commit 814d51f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

include/linux/pm_qos.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,11 +143,24 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf,
143143
struct pm_qos_flags_request *req,
144144
enum pm_qos_req_action action, s32 val);
145145

146+
#ifdef CONFIG_CPU_IDLE
146147
s32 cpu_latency_qos_limit(void);
147148
bool cpu_latency_qos_request_active(struct pm_qos_request *req);
148149
void cpu_latency_qos_add_request(struct pm_qos_request *req, s32 value);
149150
void cpu_latency_qos_update_request(struct pm_qos_request *req, s32 new_value);
150151
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
151164

152165
#ifdef CONFIG_PM
153166
enum pm_qos_flags_status __dev_pm_qos_flags(struct device *dev, s32 mask);

kernel/power/qos.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ bool pm_qos_update_flags(struct pm_qos_flags *pqf,
209209
return prev_value != curr_value;
210210
}
211211

212+
#ifdef CONFIG_CPU_IDLE
212213
/* Definitions related to the CPU latency QoS. */
213214

214215
static struct pm_qos_constraints cpu_latency_constraints = {
@@ -421,6 +422,7 @@ static int __init cpu_latency_qos_init(void)
421422
return ret;
422423
}
423424
late_initcall(cpu_latency_qos_init);
425+
#endif /* CONFIG_CPU_IDLE */
424426

425427
/* Definitions related to the frequency QoS below. */
426428

0 commit comments

Comments
 (0)