Commit 39688ce6 authored by Rajagopal Venkat's avatar Rajagopal Venkat Committed by MyungJoo Ham

PM / devfreq: account suspend/resume for stats

devfreq stats is not taking device suspend and resume into
account. Fix it.
Signed-off-by: default avatarRajagopal Venkat <rajagopal.venkat@linaro.org>
Acked-by: default avatarMyungJoo Ham <myungjoo.ham@samsung.com>
parent 6ccce699
...@@ -271,6 +271,7 @@ void devfreq_monitor_suspend(struct devfreq *devfreq) ...@@ -271,6 +271,7 @@ void devfreq_monitor_suspend(struct devfreq *devfreq)
return; return;
} }
devfreq_update_status(devfreq, devfreq->previous_freq);
devfreq->stop_polling = true; devfreq->stop_polling = true;
mutex_unlock(&devfreq->lock); mutex_unlock(&devfreq->lock);
cancel_delayed_work_sync(&devfreq->work); cancel_delayed_work_sync(&devfreq->work);
...@@ -287,6 +288,8 @@ EXPORT_SYMBOL(devfreq_monitor_suspend); ...@@ -287,6 +288,8 @@ EXPORT_SYMBOL(devfreq_monitor_suspend);
*/ */
void devfreq_monitor_resume(struct devfreq *devfreq) void devfreq_monitor_resume(struct devfreq *devfreq)
{ {
unsigned long freq;
mutex_lock(&devfreq->lock); mutex_lock(&devfreq->lock);
if (!devfreq->stop_polling) if (!devfreq->stop_polling)
goto out; goto out;
...@@ -295,8 +298,14 @@ void devfreq_monitor_resume(struct devfreq *devfreq) ...@@ -295,8 +298,14 @@ void devfreq_monitor_resume(struct devfreq *devfreq)
devfreq->profile->polling_ms) devfreq->profile->polling_ms)
queue_delayed_work(devfreq_wq, &devfreq->work, queue_delayed_work(devfreq_wq, &devfreq->work,
msecs_to_jiffies(devfreq->profile->polling_ms)); msecs_to_jiffies(devfreq->profile->polling_ms));
devfreq->last_stat_updated = jiffies;
devfreq->stop_polling = false; devfreq->stop_polling = false;
if (devfreq->profile->get_cur_freq &&
!devfreq->profile->get_cur_freq(devfreq->dev.parent, &freq))
devfreq->previous_freq = freq;
out: out:
mutex_unlock(&devfreq->lock); mutex_unlock(&devfreq->lock);
} }
...@@ -905,11 +914,11 @@ static ssize_t show_trans_table(struct device *dev, struct device_attribute *att ...@@ -905,11 +914,11 @@ static ssize_t show_trans_table(struct device *dev, struct device_attribute *att
{ {
struct devfreq *devfreq = to_devfreq(dev); struct devfreq *devfreq = to_devfreq(dev);
ssize_t len; ssize_t len;
int i, j, err; int i, j;
unsigned int max_state = devfreq->profile->max_state; unsigned int max_state = devfreq->profile->max_state;
err = devfreq_update_status(devfreq, devfreq->previous_freq); if (!devfreq->stop_polling &&
if (err) devfreq_update_status(devfreq, devfreq->previous_freq))
return 0; return 0;
len = sprintf(buf, " From : To\n"); len = sprintf(buf, " From : To\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment