The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Xiaoguang Chen <chenxg@marvell.com>
To: linux-kernel@vger.kernel.org
Cc: myungjoo.ham@samsung.com, kyungmin.park@samsung.com,
	mturquette@ti.com, axel.lin@gmail.com,
	Xiaoguang Chen <chenxg@marvell.com>
Subject: [PATCH] PM: Devfreq: fix userspace governor frequency bug
Date: Tue,  3 Jul 2012 17:08:34 +0800	[thread overview]
Message-ID: <1341306514-19173-1-git-send-email-chenxg@marvell.com> (raw)

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


             reply	other threads:[~2012-07-03  9:08 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03  9:08 Xiaoguang Chen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2012-07-03  9:53 [PATCH] PM: Devfreq: fix userspace governor frequency bug MyungJoo Ham

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1341306514-19173-1-git-send-email-chenxg@marvell.com \
    --to=chenxg@marvell.com \
    --cc=axel.lin@gmail.com \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@ti.com \
    --cc=myungjoo.ham@samsung.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox