Skip to contentSkip to conversation

Patch "cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set" has been added to the 4.8-stable tree

PATCH [email protected] 1 participant 1 message Nov 15, 2016

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set

to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
cpupower-correct-return-type-of-cpu_power_is_cpu_online-in-cpufreq-set.patch
and it can be found in the queue-4.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From c25badc9ceb612c6cc227a6fc4b0aaf678e3bcf9 Mon Sep 17 00:00:00 2001

From: Laura Abbott <[email protected]>
Date: Wed, 19 Oct 2016 15:53:52 -0700
Subject: cpupower: Correct return type of cpu_power_is_cpu_online() in cpufreq-set

From: Laura Abbott <[email protected]>

commit c25badc9ceb612c6cc227a6fc4b0aaf678e3bcf9 upstream.

When converting to a shared library in ac5a181d065d ("cpupower: Add cpuidle parts into library"), cpu_freq_cpu_exists() was converted to cpupower_is_cpu_online(). cpu_req_cpu_exists() returned 0 on success and -ENOSYS on failure whereas cpupower_is_cpu_online returns 1 on success. Check for the correct return value in cpufreq-set.

---
 tools/power/cpupower/utils/cpufreq-set.c |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
tools/power/cpupower/utils/cpufreq-set.c +2 -5
@@ -296,7 +296,7 @@ int cmd_freq_set(int argc, char **argv)
 			struct cpufreq_affected_cpus *cpus;
 
 			if (!bitmask_isbitset(cpus_chosen, cpu) ||
-			    cpupower_is_cpu_online(cpu))
+			    cpupower_is_cpu_online(cpu) != 1)
 				continue;
 
 			cpus = cpufreq_get_related_cpus(cpu);
@@ -316,10 +316,7 @@ int cmd_freq_set(int argc, char **argv)
 	     cpu <= bitmask_last(cpus_chosen); cpu++) {
 
 		if (!bitmask_isbitset(cpus_chosen, cpu) ||
-		    cpupower_is_cpu_online(cpu))
-			continue;
-
-		if (cpupower_is_cpu_online(cpu) != 1)
+		    cpupower_is_cpu_online(cpu) != 1)
 			continue;
 
 		printf(_("Setting cpu: %d\n"), cpu);

Patches currently in stable-queue which might be from [email protected] are

queue-4.8/cpupower-correct-return-type-of-cpu_power_is_cpu_online-in-cpufreq-set.patch