Lines Matching +full:entry +full:- +full:latency
1 // SPDX-License-Identifier: GPL-2.0-only
15 * or through a built-in notification mechanism.
18 * global CPU latency QoS requests and frequency QoS requests are provided.
50 * pm_qos_read_value - Return the current effective constraint value.
55 return READ_ONCE(c->target_value); in pm_qos_read_value()
60 if (plist_head_empty(&c->list)) in pm_qos_get_value()
61 return c->no_constraint_value; in pm_qos_get_value()
63 switch (c->type) { in pm_qos_get_value()
65 return plist_first(&c->list)->prio; in pm_qos_get_value()
68 return plist_last(&c->list)->prio; in pm_qos_get_value()
78 WRITE_ONCE(c->target_value, value); in pm_qos_set_value()
82 * pm_qos_update_target - Update a list of PM QoS constraint requests.
84 * @node: Target list entry.
86 * @value: New request value for the target list entry.
89 * @action involving the @node list entry and @value on it.
108 new_value = c->default_value; in pm_qos_update_target()
114 plist_del(node, &c->list); in pm_qos_update_target()
121 plist_del(node, &c->list); in pm_qos_update_target()
125 plist_add(node, &c->list); in pm_qos_update_target()
142 if (c->notifiers) in pm_qos_update_target()
143 blocking_notifier_call_chain(c->notifiers, curr_value, NULL); in pm_qos_update_target()
149 * pm_qos_flags_remove_req - Remove device PM QoS flags request.
158 list_del(&req->node); in pm_qos_flags_remove_req()
159 list_for_each_entry(req, &pqf->list, node) in pm_qos_flags_remove_req()
160 val |= req->flags; in pm_qos_flags_remove_req()
162 pqf->effective_flags = val; in pm_qos_flags_remove_req()
166 * pm_qos_update_flags - Update a set of PM QoS flags.
183 prev_value = list_empty(&pqf->list) ? 0 : pqf->effective_flags; in pm_qos_update_flags()
193 req->flags = val; in pm_qos_update_flags()
194 INIT_LIST_HEAD(&req->node); in pm_qos_update_flags()
195 list_add_tail(&req->node, &pqf->list); in pm_qos_update_flags()
196 pqf->effective_flags |= val; in pm_qos_update_flags()
203 curr_value = list_empty(&pqf->list) ? 0 : pqf->effective_flags; in pm_qos_update_flags()
213 /* Definitions related to the CPU latency QoS. */
224 * cpu_latency_qos_limit - Return current system-wide CPU latency QoS limit.
232 * cpu_latency_qos_request_active - Check the given PM QoS request.
235 * Return: 'true' if @req has been added to the CPU latency QoS list, 'false'
240 return req->qos == &cpu_latency_constraints; in cpu_latency_qos_request_active()
247 int ret = pm_qos_update_target(req->qos, &req->node, action, value); in cpu_latency_qos_apply()
253 * cpu_latency_qos_add_request - Add new CPU latency QoS request.
258 * a new entry to the CPU latency QoS list and recompute the effective QoS
276 req->qos = &cpu_latency_constraints; in cpu_latency_qos_add_request()
282 * cpu_latency_qos_update_request - Modify existing CPU latency QoS request.
287 * latency QoS list along with updating the effective constraint value for that
302 if (new_value == req->node.prio) in cpu_latency_qos_update_request()
310 * cpu_latency_qos_remove_request - Remove existing CPU latency QoS request.
313 * Remove the CPU latency QoS request represented by @req from the CPU latency
333 /* User space interface to the CPU latency QoS via misc device. */
341 return -ENOMEM; in cpu_latency_qos_open()
344 filp->private_data = req; in cpu_latency_qos_open()
351 struct pm_qos_request *req = filp->private_data; in cpu_latency_qos_release()
353 filp->private_data = NULL; in cpu_latency_qos_release()
364 struct pm_qos_request *req = filp->private_data; in cpu_latency_qos_read()
369 return -EINVAL; in cpu_latency_qos_read()
385 return -EFAULT; in cpu_latency_qos_write()
394 cpu_latency_qos_update_request(filp->private_data, value); in cpu_latency_qos_write()
430 * freq_constraints_init - Initialize frequency QoS constraints.
437 c = &qos->min_freq; in freq_constraints_init()
438 plist_head_init(&c->list); in freq_constraints_init()
439 c->target_value = FREQ_QOS_MIN_DEFAULT_VALUE; in freq_constraints_init()
440 c->default_value = FREQ_QOS_MIN_DEFAULT_VALUE; in freq_constraints_init()
441 c->no_constraint_value = FREQ_QOS_MIN_DEFAULT_VALUE; in freq_constraints_init()
442 c->type = PM_QOS_MAX; in freq_constraints_init()
443 c->notifiers = &qos->min_freq_notifiers; in freq_constraints_init()
444 BLOCKING_INIT_NOTIFIER_HEAD(c->notifiers); in freq_constraints_init()
446 c = &qos->max_freq; in freq_constraints_init()
447 plist_head_init(&c->list); in freq_constraints_init()
448 c->target_value = FREQ_QOS_MAX_DEFAULT_VALUE; in freq_constraints_init()
449 c->default_value = FREQ_QOS_MAX_DEFAULT_VALUE; in freq_constraints_init()
450 c->no_constraint_value = FREQ_QOS_MAX_DEFAULT_VALUE; in freq_constraints_init()
451 c->type = PM_QOS_MIN; in freq_constraints_init()
452 c->notifiers = &qos->max_freq_notifiers; in freq_constraints_init()
453 BLOCKING_INIT_NOTIFIER_HEAD(c->notifiers); in freq_constraints_init()
457 * freq_qos_read_value - Get frequency QoS constraint for a given list.
470 pm_qos_read_value(&qos->min_freq); in freq_qos_read_value()
475 pm_qos_read_value(&qos->max_freq); in freq_qos_read_value()
486 * freq_qos_apply - Add/modify/remove frequency QoS request.
498 switch(req->type) { in freq_qos_apply()
500 ret = pm_qos_update_target(&req->qos->min_freq, &req->pnode, in freq_qos_apply()
504 ret = pm_qos_update_target(&req->qos->max_freq, &req->pnode, in freq_qos_apply()
508 ret = -EINVAL; in freq_qos_apply()
515 * freq_qos_add_request - Insert new frequency QoS request into a given list.
521 * Insert a new entry into the @qos list of requests, recompute the effective
535 return -EINVAL; in freq_qos_add_request()
539 return -EINVAL; in freq_qos_add_request()
541 req->qos = qos; in freq_qos_add_request()
542 req->type = type; in freq_qos_add_request()
545 req->qos = NULL; in freq_qos_add_request()
546 req->type = 0; in freq_qos_add_request()
554 * freq_qos_update_request - Modify existing frequency QoS request.
567 return -EINVAL; in freq_qos_update_request()
571 return -EINVAL; in freq_qos_update_request()
573 if (req->pnode.prio == new_value) in freq_qos_update_request()
581 * freq_qos_remove_request - Remove frequency QoS request from its list.
595 return -EINVAL; in freq_qos_remove_request()
599 return -EINVAL; in freq_qos_remove_request()
602 req->qos = NULL; in freq_qos_remove_request()
603 req->type = 0; in freq_qos_remove_request()
610 * freq_qos_add_notifier - Add frequency QoS change notifier.
622 return -EINVAL; in freq_qos_add_notifier()
626 ret = blocking_notifier_chain_register(qos->min_freq.notifiers, in freq_qos_add_notifier()
630 ret = blocking_notifier_chain_register(qos->max_freq.notifiers, in freq_qos_add_notifier()
635 ret = -EINVAL; in freq_qos_add_notifier()
643 * freq_qos_remove_notifier - Remove frequency QoS change notifier.
655 return -EINVAL; in freq_qos_remove_notifier()
659 ret = blocking_notifier_chain_unregister(qos->min_freq.notifiers, in freq_qos_remove_notifier()
663 ret = blocking_notifier_chain_unregister(qos->max_freq.notifiers, in freq_qos_remove_notifier()
668 ret = -EINVAL; in freq_qos_remove_notifier()