summaryrefslogtreecommitdiff
path: root/drivers/devfreq
diff options
context:
space:
mode:
authorRajagopal Venkat <rajagopal.venkat@linaro.org>2013-01-08 05:50:39 +0000
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:47:51 +0900
commit1bf8d4cfb721a2258b25f2b6ad234b624c0db9d8 (patch)
treed6bfd9bb7f7ca9f0a77e169cd5798448d0ee0d2b /drivers/devfreq
parente3660e7e70b2856df36bdfeef54561af6bad6f19 (diff)
downloadlinux-3.10-1bf8d4cfb721a2258b25f2b6ad234b624c0db9d8.tar.gz
linux-3.10-1bf8d4cfb721a2258b25f2b6ad234b624c0db9d8.tar.bz2
linux-3.10-1bf8d4cfb721a2258b25f2b6ad234b624c0db9d8.zip
PM / devfreq: account suspend/resume for stats
devfreq stats is not taking device suspend and resume into account. Fix it. Change-Id: I224e046c15b40a384e6c548c6bd569e90a877945 Signed-off-by: Rajagopal Venkat <rajagopal.venkat@linaro.org> Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r--drivers/devfreq/devfreq.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 3b367973a80..abfa14dd8b4 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -271,6 +271,7 @@ void devfreq_monitor_suspend(struct devfreq *devfreq)
return;
}
+ devfreq_update_status(devfreq, devfreq->previous_freq);
devfreq->stop_polling = true;
mutex_unlock(&devfreq->lock);
cancel_delayed_work_sync(&devfreq->work);
@@ -287,6 +288,8 @@ EXPORT_SYMBOL(devfreq_monitor_suspend);
*/
void devfreq_monitor_resume(struct devfreq *devfreq)
{
+ unsigned long freq;
+
mutex_lock(&devfreq->lock);
if (!devfreq->stop_polling)
goto out;
@@ -295,8 +298,14 @@ void devfreq_monitor_resume(struct devfreq *devfreq)
devfreq->profile->polling_ms)
queue_delayed_work(devfreq_wq, &devfreq->work,
msecs_to_jiffies(devfreq->profile->polling_ms));
+
+ devfreq->last_stat_updated = jiffies;
devfreq->stop_polling = false;
+ if (devfreq->profile->get_cur_freq &&
+ !devfreq->profile->get_cur_freq(devfreq->dev.parent, &freq))
+ devfreq->previous_freq = freq;
+
out:
mutex_unlock(&devfreq->lock);
}
@@ -905,11 +914,11 @@ static ssize_t show_trans_table(struct device *dev, struct device_attribute *att
{
struct devfreq *devfreq = to_devfreq(dev);
ssize_t len;
- int i, j, err;
+ int i, j;
unsigned int max_state = devfreq->profile->max_state;
- err = devfreq_update_status(devfreq, devfreq->previous_freq);
- if (err)
+ if (!devfreq->stop_polling &&
+ devfreq_update_status(devfreq, devfreq->previous_freq))
return 0;
len = sprintf(buf, " From : To\n");