PM: Devfreq: fix userspace governor frequency bug
Quoted 10 lines
The frequency set by userspace governor may not the same as the final frequency. If this condition happens, then "cat
set_freq" will return a wrong value which is inconsistant with the real frequency.This patch updates
data->user_frequencyafter calling ofupdate_devfreq. usedevfreq->revious_freqas the finaluser_frequency.Signed-off-by Xiaoguang Chen <[email protected]>
No, this is not a bug.
---- quoting Documentation/ABI/testing/sysfs-class-devfreq ----
What: /sys/class/devfreq/.../userspace/set_freq Date: September 2011 Contact: MyungJoo Ham <[email protected]>
Description:
The /sys/class/devfreq/.../userspace/set_freq shows and sets the requested frequency for the devfreq object if userspace governor is in effect.
---- quote ended ----
set_freq shows the requested frequency, not the actual frequency value.
If you want to see the actual current frequency intended by devfreq, use "cur_freq".
Cheers!
MyungJoo
Quoted 19 lines
--- drivers/devfreq/governor_userspace.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)drivers/devfreq/governor_userspace.c +1
-0@@ -59,6 +59,7 @@ static ssize_t store_freq(struct device *dev, struct device_attribute *attr, err =update_devfreq (devfreq);if (err ==0 ) err = count; + data->user_frequency = devfreq->previous_freq;mutex_unlock (&devfreq->lock);return err; }Signature · 1 line
1.7.0.4
�淸�{.n�+돴윯돪�+%듚�깁負쪐w��{.n�+돴쪐{깸G쳺��{ay����,j�f"톒쉹��묎�z_溫(�쉸듶줷"얎�m����G쳺�◀?솳鈺�&x�~뤳턨O뺞촾퇉v�^�m����띠�◀?뻀�