[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200626102255.GZ4817@hirez.programming.kicks-ass.net>
Date: Fri, 26 Jun 2020 12:22:55 +0200
From: Peter Zijlstra <peterz@...radead.org>
To: Borislav Petkov <bp@...en8.de>
Cc: Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
rjw@...ysocki.net, viresh.kumar@...aro.org, lenb@...nel.org,
dsmythies@...us.net, tglx@...utronix.de, mingo@...hat.com,
hpa@...or.com, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [UPDATE][PATCH v3 1/2] cpufreq: intel_pstate: Allow
enable/disable energy efficiency
On Fri, Jun 26, 2020 at 10:49:03AM +0200, Borislav Petkov wrote:
> On Thu, Jun 25, 2020 at 03:49:31PM -0700, Srinivas Pandruvada wrote:
> > +static ssize_t store_energy_efficiency_enable(struct kobject *a,
> > + struct kobj_attribute *b,
> > + const char *buf, size_t count)
> > +{
> > + u64 power_ctl;
> > + u32 input;
> > + int ret;
> > +
> > + ret = kstrtouint(buf, 10, &input);
> > + if (ret)
> > + return ret;
> > +
> > + mutex_lock(&intel_pstate_driver_lock);
> > + rdmsrl(MSR_IA32_POWER_CTL, power_ctl);
> > + if (input)
>
> This is too lax - it will be enabled for any !0 value. Please accept
> only 0 and 1.
kstrtobool() ftw
Powered by blists - more mailing lists