PM: QoS: Introduce frequency QoS
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>
Wed, 16 Oct 2019 10:41:24 +0000 (12:41 +0200)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 21 Oct 2019 00:05:21 +0000 (02:05 +0200)
commit77751a466ebd1a785456556061a2db6d60ea3898
treed1c1b1a776630774675e674965dfe3bbc54b05b5
parent7d194c2100ad2a6dded545887d02754948ca5241
PM: QoS: Introduce frequency QoS

Introduce frequency QoS, based on the "raw" low-level PM QoS, to
represent min and max frequency requests and aggregate constraints.

The min and max frequency requests are to be represented by
struct freq_qos_request objects and the aggregate constraints are to
be represented by struct freq_constraints objects.  The latter are
expected to be initialized with the help of freq_constraints_init().

The freq_qos_read_value() helper is defined to retrieve the aggregate
constraints values from a given struct freq_constraints object and
there are the freq_qos_add_request(), freq_qos_update_request() and
freq_qos_remove_request() helpers to manipulate the min and max
frequency requests.  It is assumed that the the helpers will not
run concurrently with each other for the same struct freq_qos_request
object, so if that may be the case, their uses must ensure proper
synchronization between them (e.g. through locking).

In addition, freq_qos_add_notifier() and freq_qos_remove_notifier()
are provided to add and remove notifiers that will trigger on aggregate
constraint changes to and from a given struct freq_constraints object,
respectively.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
include/linux/pm_qos.h
kernel/power/qos.c