lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 30 Aug 2012 18:00:03 +0900
From:	MyungJoo Ham <myungjoo.ham@...sung.com>
To:	linux-pm@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:	myungjoo.ham@...il.com, rjw@...k.pl, kyungmin.park@...sung.com,
	khilman@...com, markgross@...gnar.org, jean.pihet@...oldbits.com,
	mturquette@...com, jonghwa3.lee@...sung.com
Subject: [PATCH v3 2/2] PM / devfreq: support per-dev PM-QoS in devfreq

Added support of per-dev PM-QoS request handling in devfreq core.

Signed-off-by: MyungJoo Ham <myungjoo.ham@...sung.com>
---
 drivers/devfreq/devfreq.c |   24 ++++++++++++++++--------
 1 files changed, 16 insertions(+), 8 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index d74b382..e2ae575 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -268,6 +268,9 @@ static void _remove_devfreq(struct devfreq *devfreq, bool skip)
 
 	devfreq->being_removed = true;
 
+	if (devfreq->profile->enable_dev_pm_qos)
+		dev_pm_qos_remove_notifier(devfreq->dev.parent,
+					   &devfreq->qos_nb);
 	if (devfreq->profile->qos_type)
 		pm_qos_remove_notifier(devfreq->profile->qos_type,
 				       &devfreq->qos_nb);
@@ -484,13 +487,13 @@ struct devfreq *devfreq_add_device(struct device *dev,
 	devfreq->nb.notifier_call = devfreq_notifier_call;
 	devfreq->qos_nb.notifier_call = devfreq_qos_notifier_call;
 
-	/* Check the sanity of qos_list/qos_type */
-	if (profile->qos_type || profile->qos_list) {
-
-		if (WARN(!profile->qos_type || !profile->qos_list,
+	/* Check the sanity of QoS handling specifications */
+	if (profile->qos_type || profile->enable_dev_pm_qos ||
+	    profile->qos_list) {
+		if (WARN(!profile->qos_list ||
+			 (!profile->qos_type && !profile->enable_dev_pm_qos),
 			 "QoS requirement partially omitted for %s.\n",
 			 dev_name(dev))) {
-
 			err = -EINVAL;
 			goto err_dev;
 		}
@@ -498,7 +501,6 @@ struct devfreq *devfreq_add_device(struct device *dev,
 		if (WARN(!profile->qos_list[0].freq,
 			 "The first QoS requirement is the end of list for %s.\n",
 			 dev_name(dev))) {
-
 			err = -EINVAL;
 			goto err_dev;
 		}
@@ -535,7 +537,11 @@ struct devfreq *devfreq_add_device(struct device *dev,
 			}
 		}
 
-		pm_qos_add_notifier(profile->qos_type, &devfreq->qos_nb);
+		if (profile->qos_type)
+			pm_qos_add_notifier(profile->qos_type,
+					    &devfreq->qos_nb);
+		if (profile->enable_dev_pm_qos)
+			dev_pm_qos_add_notifier(dev, &devfreq->qos_nb);
 	}
 
 	devfreq->trans_table =	devm_kzalloc(dev, sizeof(unsigned int) *
@@ -580,7 +586,9 @@ out:
 err_init:
 	device_unregister(&devfreq->dev);
 err_qos_add:
-	if (profile->qos_type || profile->qos_list)
+	if (profile->enable_dev_pm_qos)
+		dev_pm_qos_remove_notifier(dev, &devfreq->qos_nb);
+	if (profile->qos_type)
 		pm_qos_remove_notifier(profile->qos_type, &devfreq->qos_nb);
 err_dev:
 	mutex_unlock(&devfreq->lock);
-- 
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ