diff options
author | Chanwoo Choi <cw00.choi@samsung.com> | 2017-01-31 01:38:17 -0500 |
---|---|---|
committer | MyungJoo Ham <myungjoo.ham@samsung.com> | 2017-01-31 01:47:32 -0500 |
commit | 30582c25a4b4e0a5e456a309fde79b845e9473b2 (patch) | |
tree | fa6fe105766dcb2e1e8f0fbabbb5cd9354385014 /drivers/devfreq | |
parent | bcf23c79c4e46130701370af4383b61a3cba755c (diff) |
PM / devfreq: Fix wrong trans_stat of passive devfreq device
Until now, the trans_stat information of passive devfreq is not updated.
This patch updates the trans_stat information after setting the target
frequency of passive devfreq device.
Fixes: 996133119f57 ("PM / devfreq: Add new passive governor")
Cc: stable@vger.kernel.org
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
Diffstat (limited to 'drivers/devfreq')
-rw-r--r-- | drivers/devfreq/devfreq.c | 3 | ||||
-rw-r--r-- | drivers/devfreq/governor.h | 2 | ||||
-rw-r--r-- | drivers/devfreq/governor_passive.c | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index ade279d29f1e..4e86cc0106df 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c | |||
@@ -130,7 +130,7 @@ static void devfreq_set_freq_table(struct devfreq *devfreq) | |||
130 | * @devfreq: the devfreq instance | 130 | * @devfreq: the devfreq instance |
131 | * @freq: the update target frequency | 131 | * @freq: the update target frequency |
132 | */ | 132 | */ |
133 | static int devfreq_update_status(struct devfreq *devfreq, unsigned long freq) | 133 | int devfreq_update_status(struct devfreq *devfreq, unsigned long freq) |
134 | { | 134 | { |
135 | int lev, prev_lev, ret = 0; | 135 | int lev, prev_lev, ret = 0; |
136 | unsigned long cur_time; | 136 | unsigned long cur_time; |
@@ -166,6 +166,7 @@ out: | |||
166 | devfreq->last_stat_updated = cur_time; | 166 | devfreq->last_stat_updated = cur_time; |
167 | return ret; | 167 | return ret; |
168 | } | 168 | } |
169 | EXPORT_SYMBOL(devfreq_update_status); | ||
169 | 170 | ||
170 | /** | 171 | /** |
171 | * find_devfreq_governor() - find devfreq governor from name | 172 | * find_devfreq_governor() - find devfreq governor from name |
diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h index fad7d6321978..71576b8bdfef 100644 --- a/drivers/devfreq/governor.h +++ b/drivers/devfreq/governor.h | |||
@@ -38,4 +38,6 @@ extern void devfreq_interval_update(struct devfreq *devfreq, | |||
38 | extern int devfreq_add_governor(struct devfreq_governor *governor); | 38 | extern int devfreq_add_governor(struct devfreq_governor *governor); |
39 | extern int devfreq_remove_governor(struct devfreq_governor *governor); | 39 | extern int devfreq_remove_governor(struct devfreq_governor *governor); |
40 | 40 | ||
41 | extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq); | ||
42 | |||
41 | #endif /* _GOVERNOR_H */ | 43 | #endif /* _GOVERNOR_H */ |
diff --git a/drivers/devfreq/governor_passive.c b/drivers/devfreq/governor_passive.c index 93795b32dc09..5be96b2249e7 100644 --- a/drivers/devfreq/governor_passive.c +++ b/drivers/devfreq/governor_passive.c | |||
@@ -112,6 +112,11 @@ static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq) | |||
112 | if (ret < 0) | 112 | if (ret < 0) |
113 | goto out; | 113 | goto out; |
114 | 114 | ||
115 | if (devfreq->profile->freq_table | ||
116 | && (devfreq_update_status(devfreq, freq))) | ||
117 | dev_err(&devfreq->dev, | ||
118 | "Couldn't update frequency transition information.\n"); | ||
119 | |||
115 | devfreq->previous_freq = freq; | 120 | devfreq->previous_freq = freq; |
116 | 121 | ||
117 | out: | 122 | out: |