lkml.org 
[lkml]   [2012]   [Aug]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v3 2/2] PM / devfreq: support per-dev PM-QoS in devfreq
Date
Added support of per-dev PM-QoS request handling in devfreq core.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.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


\
 
 \ /
  Last update: 2012-08-30 11:41    [W:0.055 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site