Thread (10 messages) 10 messages, 7 authors, 2020-07-01

Re: [UPDATE][PATCH v3 1/2] cpufreq: intel_pstate: Allow enable/disable energy efficiency

From: Peter Zijlstra <peterz@infradead.org>
Date: 2020-06-26 10:23:35
Also in: lkml

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:
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help