PM / devfreq: Fix wrong trans_stat of passive devfreq device
authorChanwoo Choi <cw00.choi@samsung.com>
Tue, 31 Jan 2017 06:38:17 +0000 (15:38 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Tue, 31 Jan 2017 06:47:32 +0000 (15:47 +0900)
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>
drivers/devfreq/devfreq.c
drivers/devfreq/governor.h
drivers/devfreq/governor_passive.c

index ade279d29f1e2b65c1db437a4a26460812f461db..4e86cc0106df7598116f136ad6a55830fe4915b3 100644 (file)
@@ -130,7 +130,7 @@ static void devfreq_set_freq_table(struct devfreq *devfreq)
  * @devfreq:   the devfreq instance
  * @freq:      the update target frequency
  */
-static int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
+int devfreq_update_status(struct devfreq *devfreq, unsigned long freq)
 {
        int lev, prev_lev, ret = 0;
        unsigned long cur_time;
@@ -166,6 +166,7 @@ out:
        devfreq->last_stat_updated = cur_time;
        return ret;
 }
+EXPORT_SYMBOL(devfreq_update_status);
 
 /**
  * find_devfreq_governor() - find devfreq governor from name
index fad7d63219786387e191ea4130bf5a0b7b37001b..71576b8bdfeff2f5fc5a1e5108eef21c35396949 100644 (file)
@@ -38,4 +38,6 @@ extern void devfreq_interval_update(struct devfreq *devfreq,
 extern int devfreq_add_governor(struct devfreq_governor *governor);
 extern int devfreq_remove_governor(struct devfreq_governor *governor);
 
+extern int devfreq_update_status(struct devfreq *devfreq, unsigned long freq);
+
 #endif /* _GOVERNOR_H */
index 93795b32dc09b1b0af746fc5cdfccf414ad0f209..5be96b2249e72a1e8cf1280f1c5a10bdfd54a6d3 100644 (file)
@@ -112,6 +112,11 @@ static int update_devfreq_passive(struct devfreq *devfreq, unsigned long freq)
        if (ret < 0)
                goto out;
 
+       if (devfreq->profile->freq_table
+               && (devfreq_update_status(devfreq, freq)))
+               dev_err(&devfreq->dev,
+                       "Couldn't update frequency transition information.\n");
+
        devfreq->previous_freq = freq;
 
 out: