From: "Rafael J. Wysocki" <rjw@sisk.pl>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: ACPI Devel Mailing List <linux-acpi@vger.kernel.org>,
Alan Stern <stern@rowland.harvard.edu>,
Huang Ying <ying.huang@intel.com>,
Sarah Sharp <sarah.a.sharp@linux.intel.com>,
Lan Tianyu <tianyu.lan@intel.com>, Aaron Lu <aaron.lu@intel.com>,
Jean Pihet <j-pihet@ti.com>,
linux-pci@vger.kernel.org,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
mark gross <markgross@thegnar.org>
Subject: [RFD][PATCH 3/7] PM / QoS: Prepare struct dev_pm_qos_request for more request types
Date: Fri, 28 Sep 2012 23:53:33 +0200 [thread overview]
Message-ID: <201209282353.33982.rjw@sisk.pl> (raw)
In-Reply-To: <201209282351.10663.rjw@sisk.pl>
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: Rafael J. Wysocki <rjw@sisk.pl>
---
drivers/base/power/qos.c | 6 +++---
drivers/base/power/sysfs.c | 2 +-
include/linux/pm_qos.h | 4 +++-
3 files changed, 7 insertions(+), 5 deletions(-)
Index: linux/include/linux/pm_qos.h
===================================================================
--- linux.orig/include/linux/pm_qos.h
+++ linux/include/linux/pm_qos.h
@@ -39,7 +39,9 @@ struct pm_qos_flags_request {
};
struct dev_pm_qos_request {
- struct plist_node node;
+ union {
+ struct plist_node pnode;
+ } data;
struct device *dev;
};
Index: linux/drivers/base/power/sysfs.c
===================================================================
--- linux.orig/drivers/base/power/sysfs.c
+++ linux/drivers/base/power/sysfs.c
@@ -221,7 +221,7 @@ static DEVICE_ATTR(autosuspend_delay_ms,
static ssize_t pm_qos_latency_show(struct device *dev,
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,
Index: linux/drivers/base/power/qos.c
===================================================================
--- linux.orig/drivers/base/power/qos.c
+++ linux/drivers/base/power/qos.c
@@ -90,7 +90,7 @@ static int apply_constraint(struct dev_p
int ret, curr_value;
ret = pm_qos_update_target(&req->dev->power.qos->latency,
- &req->node, action, value);
+ &req->data.pnode, action, value);
if (ret) {
/* Call the global callbacks if needed */
@@ -183,7 +183,7 @@ void dev_pm_qos_constraints_destroy(stru
c = &qos->latency;
/* 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
* callbacks if needed
@@ -293,7 +293,7 @@ int dev_pm_qos_update_request(struct dev
mutex_lock(&dev_pm_qos_mtx);
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,
new_value);
} else {
next prev parent reply other threads:[~2012-09-28 21:53 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-28 21:51 [RFD][PATCH 0/7] PM / QoS: Support for PM QoS device flags Rafael J. Wysocki
2012-09-28 21:52 ` [RFD][PATCH 1/7] PM / QoS: Prepare device structure for adding more constraint types Rafael J. Wysocki
2012-09-28 21:52 ` [RFD][PATCH 2/7] PM / QoS: Introduce request and constraint data types for PM QoS flags Rafael J. Wysocki
2012-09-29 6:02 ` Lan Tianyu
2012-09-29 21:36 ` Rafael J. Wysocki
2012-09-28 21:53 ` Rafael J. Wysocki [this message]
2012-09-28 21:54 ` [RFD][PATCH 4/7] PM / QoS: Introduce device PM QoS flags support Rafael J. Wysocki
2012-09-28 21:55 ` [RFD][PATCH 5/7] PM / QoS: Make it possible to expose PM QoS device flags to user space Rafael J. Wysocki
2012-10-30 8:53 ` Aaron Lu
2012-10-30 15:29 ` Rafael J. Wysocki
2012-09-28 21:56 ` [RFD][PATCH 6/7] PM / Domains: Check device PM QoS flags in pm_genpd_poweroff() Rafael J. Wysocki
2012-09-28 21:56 ` [RFD][PATCH 7/7] PM / ACPI: Take device PM QoS flags into account Rafael J. Wysocki
2012-09-29 3:16 ` Huang Ying
2012-09-29 21:39 ` Rafael J. Wysocki
2012-11-12 21:07 ` Bjorn Helgaas
2012-11-12 23:42 ` Rafael J. Wysocki
2012-10-01 16:17 ` [RFD][PATCH 0/7] PM / QoS: Support for PM QoS device flags Pihet-XID, Jean
2012-10-02 2:17 ` Rafael J. Wysocki
2012-10-08 8:02 ` [PATCH " Rafael J. Wysocki
2012-10-08 8:04 ` [PATCH 1/7] PM / QoS: Prepare device structure for adding more constraint types Rafael J. Wysocki
2012-10-10 3:15 ` mark gross
2012-10-10 23:12 ` Rafael J. Wysocki
2012-10-08 8:05 ` [PATCH 2/7] PM / QoS: Introduce request and constraint data types for PM QoS flags Rafael J. Wysocki
2012-10-10 3:21 ` mark gross
2012-10-08 8:06 ` [PATCH 3/7] PM / QoS: Prepare struct dev_pm_qos_request for more request types Rafael J. Wysocki
2012-10-10 3:37 ` mark gross
2012-10-08 8:07 ` [PATCH 4/7] PM / QoS: Introduce PM QoS device flags support Rafael J. Wysocki
2012-10-10 3:37 ` mark gross
2012-10-08 8:07 ` [PATCH 5/7] PM / QoS: Make it possible to expose PM QoS device flags to user space Rafael J. Wysocki
2012-10-10 3:33 ` mark gross
2012-10-08 8:08 ` [PATCH 6/7] PM / Domains: Check device PM QoS flags in pm_genpd_poweroff() Rafael J. Wysocki
2012-10-10 3:35 ` mark gross
2012-10-08 8:09 ` [PATCH 7/7] PM / ACPI: Take device PM QoS flags into account Rafael J. Wysocki
2012-10-09 2:46 ` Huang Ying
2012-10-10 3:36 ` mark gross
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201209282353.33982.rjw@sisk.pl \
--to=rjw@sisk.pl \
--cc=aaron.lu@intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=j-pihet@ti.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=markgross@thegnar.org \
--cc=sarah.a.sharp@linux.intel.com \
--cc=stern@rowland.harvard.edu \
--cc=tianyu.lan@intel.com \
--cc=ying.huang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).