mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH] PM: Devfreq: fix userspace governor frequency bug
@ 2012-07-03  9:53 MyungJoo Ham
  0 siblings, 0 replies; 2+ messages in thread
From: MyungJoo Ham @ 2012-07-03  9:53 UTC (permalink / raw)
  To: Xiaoguang Chen, linux-kernel
  Cc: 박경민, mturquette, axel.lin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=euc-kr, Size: 1829 bytes --]

> 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_frequency after calling
> of update_devfreq. use devfreq->revious_freq as the
> final user_frequency.
> 
> Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>

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 <myungjoo.ham@samsung.com>
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


> ---
>  drivers/devfreq/governor_userspace.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
> index 0681246..85ad80a 100644
> --- a/drivers/devfreq/governor_userspace.c
> +++ b/drivers/devfreq/governor_userspace.c
> @@ -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;
>  }
> -- 
> 1.7.0.4
> 
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] PM: Devfreq: fix userspace governor frequency bug
@ 2012-07-03  9:08 Xiaoguang Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Xiaoguang Chen @ 2012-07-03  9:08 UTC (permalink / raw)
  To: linux-kernel
  Cc: myungjoo.ham, kyungmin.park, mturquette, axel.lin, Xiaoguang Chen

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_frequency after calling
of update_devfreq. use devfreq->revious_freq as the
final user_frequency.

Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>
---
 drivers/devfreq/governor_userspace.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 0681246..85ad80a 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -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;
 }
-- 
1.7.0.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-07-03  9:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-03  9:53 [PATCH] PM: Devfreq: fix userspace governor frequency bug MyungJoo Ham
  -- strict thread matches above, loose matches on Subject: below --
2012-07-03  9:08 Xiaoguang Chen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome