lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 29 Jul 2015 16:31:46 +0530
From:	Viresh Kumar <viresh.kumar@...aro.org>
To:	Pan Xinhui <xinhuix.pan@...el.com>
Cc:	"Rafael J. Wysocki" <rjw@...ysocki.net>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"mnipxh@....com" <mnipxh@....com>,
	"yanmin_zhang@...ux.intel.com" <yanmin_zhang@...ux.intel.com>
Subject: Re: [PATCH] cpufreq: Add scaling frequency range support

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ