From: Viresh Kumar <viresh.kumar@linaro.org>
To: Pan Xinhui <xinhuix.pan@intel.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
"mnipxh@163.com" <mnipxh@163.com>,
"yanmin_zhang@linux.intel.com" <yanmin_zhang@linux.intel.com>
Subject: Re: [PATCH] cpufreq: Add scaling frequency range support
Date: Wed, 29 Jul 2015 16:31:46 +0530 [thread overview]
Message-ID: <20150729110146.GB5100@linux> (raw)
In-Reply-To: <55B8A548.4060104@intel.com>
On 29-07-15, 18:04, Pan Xinhui wrote:
> > @@ -622,21 +630,20 @@ static int cpufreq_set_policy(struct cpufreq_policy *policy,
> > static ssize_t store_##file_name \
> > (struct cpufreq_policy *policy, const char *buf, size_t count) \
> > { \
> > - int ret, temp; \
> > + int ret; \
> > struct cpufreq_policy new_policy; \
> > \
> > ret = cpufreq_get_policy(&new_policy, policy->cpu); \
> > if (ret) \
> > return -EINVAL; \
> > \
> > + cpufreq_get_user_policy_freq(&policy->user_policy, &new_policy);\
> > ret = sscanf(buf, "%u", &new_policy.object); \
> > if (ret != 1) \
> > return -EINVAL; \
> > \
> > - temp = new_policy.object; \
> > - ret = cpufreq_set_policy(policy, &new_policy); \
> > - if (!ret) \
> > - policy->user_policy.object = temp; \
> > + policy->user_policy.object = policy->object; \
> should be
> + policy->user_policy.object = new_policy.object; \
> sorry for that.
> > + ret = cpufreq_set_policy(policy, &new_policy); \
This is wrong because we save user-preference, even when we failed. So that's
surely bad.
--
viresh
next prev parent reply other threads:[~2015-07-29 11:01 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-28 3:32 [PATCH] cpufreq: Add scaling frequency range support Pan Xinhui
2015-07-28 4:29 ` Viresh Kumar
2015-07-28 4:53 ` Pan Xinhui
2015-07-29 0:18 ` Rafael J. Wysocki
2015-07-29 9:59 ` Pan Xinhui
2015-07-29 10:04 ` Pan Xinhui
2015-07-29 11:01 ` Viresh Kumar [this message]
2015-07-29 22:40 ` Rafael J. Wysocki
2015-07-28 5:20 ` Viresh Kumar
2015-07-28 7:02 ` [PATCH V2] " Pan Xinhui
2015-07-28 7:09 ` Viresh Kumar
2015-07-29 0:15 ` [PATCH] " Rafael J. Wysocki
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=20150729110146.GB5100@linux \
--to=viresh.kumar@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mnipxh@163.com \
--cc=rjw@rjwysocki.net \
--cc=xinhuix.pan@intel.com \
--cc=yanmin_zhang@linux.intel.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;
as well as URLs for NNTP newsgroup(s).