Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 021c870b authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

PM / QoS: Prepare struct dev_pm_qos_request for more request types



The subsequent patches will use struct dev_pm_qos_request for
representing both latency requests and flags requests.  To make that
easier, put the node member of struct dev_pm_qos_request (under the
name "pnode") into a union called "data" that will represent the
request's  value and list node depending on its type.

Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: default avatarJean Pihet <j-pihet@ti.com>
Reviewed-by: default avatarmark gross <markgross@thegnar.org>
parent 5efbe427
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -90,7 +90,7 @@ static int apply_constraint(struct dev_pm_qos_request *req,
	int ret, curr_value;
	int ret, curr_value;


	ret = pm_qos_update_target(&req->dev->power.qos->latency,
	ret = pm_qos_update_target(&req->dev->power.qos->latency,
				   &req->node, action, value);
				   &req->data.pnode, action, value);


	if (ret) {
	if (ret) {
		/* Call the global callbacks if needed */
		/* Call the global callbacks if needed */
@@ -183,7 +183,7 @@ void dev_pm_qos_constraints_destroy(struct device *dev)


	c = &qos->latency;
	c = &qos->latency;
	/* Flush the constraints list for the device */
	/* Flush the constraints list for the device */
	plist_for_each_entry_safe(req, tmp, &c->list, node) {
	plist_for_each_entry_safe(req, tmp, &c->list, data.pnode) {
		/*
		/*
		 * Update constraints list and call the notification
		 * Update constraints list and call the notification
		 * callbacks if needed
		 * callbacks if needed
@@ -293,7 +293,7 @@ int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
	mutex_lock(&dev_pm_qos_mtx);
	mutex_lock(&dev_pm_qos_mtx);


	if (req->dev->power.qos) {
	if (req->dev->power.qos) {
		if (new_value != req->node.prio)
		if (new_value != req->data.pnode.prio)
			ret = apply_constraint(req, PM_QOS_UPDATE_REQ,
			ret = apply_constraint(req, PM_QOS_UPDATE_REQ,
					       new_value);
					       new_value);
	} else {
	} else {
+1 −1
Original line number Original line Diff line number Diff line
@@ -221,7 +221,7 @@ static DEVICE_ATTR(autosuspend_delay_ms, 0644, autosuspend_delay_ms_show,
static ssize_t pm_qos_latency_show(struct device *dev,
static ssize_t pm_qos_latency_show(struct device *dev,
				   struct device_attribute *attr, char *buf)
				   struct device_attribute *attr, char *buf)
{
{
	return sprintf(buf, "%d\n", dev->power.pq_req->node.prio);
	return sprintf(buf, "%d\n", dev->power.pq_req->data.pnode.prio);
}
}


static ssize_t pm_qos_latency_store(struct device *dev,
static ssize_t pm_qos_latency_store(struct device *dev,
+3 −1
Original line number Original line Diff line number Diff line
@@ -39,7 +39,9 @@ struct pm_qos_flags_request {
};
};


struct dev_pm_qos_request {
struct dev_pm_qos_request {
	struct plist_node node;
	union {
		struct plist_node pnode;
	} data;
	struct device *dev;
	struct device *dev;
};
};