linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Linux PM list <linux-pm@vger.kernel.org>
Cc: ACPI Devel Maling List <linux-acpi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: [RFC/RFT][PATCH 2/5] PM / QoS: Add no_constraints_value field to struct pm_qos_constraints
Date: Fri, 17 Jan 2014 15:44:42 +0100	[thread overview]
Message-ID: <19067088.JLdRPV4Ja3@vostro.rjw.lan> (raw)
In-Reply-To: <5434847.aCyiWHNRe7@vostro.rjw.lan>

From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Add a new field, no_constraints_value, to struct pm_qos_constraints
representing a list of PM QoS constraint requests to be returned by
pm_qos_get_value() when that list of requests is empty.

That field will be equal to default_value for all of the existing
global PM QoS classes and for the resume latency device PM QoS type,
but it will be different from default_value for the new latency
tolerance device PM QoS type introduced by the next changeset.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
 drivers/base/power/qos.c |    1 +
 include/linux/pm_qos.h   |    1 +
 kernel/power/qos.c       |    5 ++++-
 3 files changed, 6 insertions(+), 1 deletion(-)

Index: linux-pm/drivers/base/power/qos.c
===================================================================
--- linux-pm.orig/drivers/base/power/qos.c
+++ linux-pm/drivers/base/power/qos.c
@@ -190,6 +190,7 @@ static int dev_pm_qos_constraints_alloca
 	plist_head_init(&c->list);
 	c->target_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
 	c->default_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
+	c->no_constraint_value = PM_QOS_RESUME_LATENCY_DEFAULT_VALUE;
 	c->type = PM_QOS_MIN;
 	c->notifiers = n;
 
Index: linux-pm/include/linux/pm_qos.h
===================================================================
--- linux-pm.orig/include/linux/pm_qos.h
+++ linux-pm/include/linux/pm_qos.h
@@ -77,6 +77,7 @@ struct pm_qos_constraints {
 	struct plist_head list;
 	s32 target_value;	/* Do not change to 64 bit */
 	s32 default_value;
+	s32 no_constraint_value;
 	enum pm_qos_type type;
 	struct blocking_notifier_head *notifiers;
 };
Index: linux-pm/kernel/power/qos.c
===================================================================
--- linux-pm.orig/kernel/power/qos.c
+++ linux-pm/kernel/power/qos.c
@@ -66,6 +66,7 @@ static struct pm_qos_constraints cpu_dma
 	.list = PLIST_HEAD_INIT(cpu_dma_constraints.list),
 	.target_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
 	.default_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
+	.no_constraint_value = PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE,
 	.type = PM_QOS_MIN,
 	.notifiers = &cpu_dma_lat_notifier,
 };
@@ -79,6 +80,7 @@ static struct pm_qos_constraints network
 	.list = PLIST_HEAD_INIT(network_lat_constraints.list),
 	.target_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
 	.default_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
+	.no_constraint_value = PM_QOS_NETWORK_LAT_DEFAULT_VALUE,
 	.type = PM_QOS_MIN,
 	.notifiers = &network_lat_notifier,
 };
@@ -93,6 +95,7 @@ static struct pm_qos_constraints network
 	.list = PLIST_HEAD_INIT(network_tput_constraints.list),
 	.target_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
 	.default_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
+	.no_constraint_value = PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE,
 	.type = PM_QOS_MAX,
 	.notifiers = &network_throughput_notifier,
 };
@@ -128,7 +131,7 @@ static const struct file_operations pm_q
 static inline int pm_qos_get_value(struct pm_qos_constraints *c)
 {
 	if (plist_head_empty(&c->list))
-		return c->default_value;
+		return c->no_constraint_value;
 
 	switch (c->type) {
 	case PM_QOS_MIN:


  parent reply	other threads:[~2014-01-17 14:38 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-17 14:42 [RFC/RFT][PATCH 0/5] PM / QoS: Introduce latency tolerance device PM QoS type Rafael J. Wysocki
2014-01-17 14:43 ` [RFC/RFT][PATCH 1/5] PM / QoS: Rename device resume latency QoS items Rafael J. Wysocki
2014-01-17 14:44 ` Rafael J. Wysocki [this message]
2014-01-17 14:45 ` [RFC/RFT][PATCH 3/5] PM / QoS: Introduce latency tolerance device PM QoS type Rafael J. Wysocki
2014-01-17 14:46 ` [RFC/RFT][PATCH 4/5] ACPI / LPSS: Support for device latency tolerance PM QoS Rafael J. Wysocki
2014-01-20 11:15   ` Mika Westerberg
2014-01-20 13:10     ` Rafael J. Wysocki
2014-01-21 23:23       ` Rafael J. Wysocki
2014-01-21 23:24         ` [RFC/RFT][PATCH 4-1/5] ACPI / scan: Add bind/unbind callbacks to struct acpi_scan_handler Rafael J. Wysocki
2014-01-21 23:25         ` [RFC/RFT][PATCH 4-2/5] ACPI / LPSS: Support for device latency tolerance PM QoS Rafael J. Wysocki
2014-01-17 14:49 ` [RFC/RFT][PATCH 5/5] PM / QoS: Add type to dev_pm_qos_add_ancestor_request() arguments Rafael J. Wysocki
2014-01-23 13:34 ` [RFC/RFT][PATCH v2 0/6] PM / QoS: Introduce latency tolerance device PM QoS type Rafael J. Wysocki
2014-01-23 13:36   ` [RFC/RFT][PATCH v2 1/6] PM / QoS: Rename device resume latency QoS items Rafael J. Wysocki
2014-01-23 13:37   ` [RFC/RFT][PATCH v2 2/6] PM / QoS: Add no_constraints_value field to struct pm_qos_constraints Rafael J. Wysocki
2014-01-23 13:37   ` [RFC/RFT][PATCH v2 3/6] PM / QoS: Introcuce latency tolerance device PM QoS type Rafael J. Wysocki
2014-01-24 22:30     ` [Update][RFC/RFT][PATCH " Rafael J. Wysocki
2014-01-23 13:38   ` [RFC/RFT][PATCH v2 4/6] ACPI / scan: Add bind/unbind callbacks to struct acpi_scan_handler Rafael J. Wysocki
2014-01-23 13:39   ` [RFC/RFT][PATCH v2 5/6] ACPI / LPSS: Support for device latency tolerance PM QoS Rafael J. Wysocki
2014-01-24 22:31     ` [Update][RFC/RFT][PATCH " Rafael J. Wysocki
2014-01-23 13:40   ` [RFC/RFT][PATCH v2 6/6] PM / QoS: Add type to dev_pm_qos_add_ancestor_request() arguments Rafael J. Wysocki
2014-01-24 14:19   ` [RFC/RFT][PATCH v2 0/6] PM / QoS: Introduce latency tolerance device PM QoS type Mika Westerberg
2014-01-24 15:30     ` Rafael J. Wysocki
2014-02-06 13:22   ` [PATCH v3 " Rafael J. Wysocki
2014-02-06 13:23     ` [PATCH v3 1/6] PM / QoS: Rename device resume latency QoS items Rafael J. Wysocki
2014-02-06 13:23     ` [PATCH v3 2/6] PM / QoS: Add no_constraints_value field to struct pm_qos_constraints Rafael J. Wysocki
2014-02-06 13:24     ` [PATCH v3 3/6] PM / QoS: Introcuce latency tolerance device PM QoS type Rafael J. Wysocki
2014-02-06 13:25     ` [PATCH v3 4/6] ACPI / scan: Add bind/unbind callbacks to struct acpi_scan_handler Rafael J. Wysocki
2014-02-06 13:26     ` [PATCH v3 5/6] ACPI / LPSS: Support for device latency tolerance PM QoS Rafael J. Wysocki
2014-02-07  1:22       ` [Update][PATCH " Rafael J. Wysocki
2014-02-06 13:27     ` [PATCH v3 6/6] PM / QoS: Add type to dev_pm_qos_add_ancestor_request() arguments Rafael J. Wysocki

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=19067088.JLdRPV4Ja3@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mika.westerberg@linux.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).