From b444ae65c91cf5664f7c5e22def171c9c4476ac5 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Fri, 17 Mar 2017 15:37:45 +0000 Subject: [PATCH] cpufreq: Fixed set_x_for cpus Fixes issue #98 where the passed `cpus` parameter was ignored when setting the governor and frequency and set for all cpus instead of those specified in the passed parameter. Also fixes kwargs not being correctly passed for governor tunables. --- devlib/module/cpufreq.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/devlib/module/cpufreq.py b/devlib/module/cpufreq.py index a0d77f6..e75a250 100644 --- a/devlib/module/cpufreq.py +++ b/devlib/module/cpufreq.py @@ -334,9 +334,8 @@ class CpufreqModule(Module): :param cpus: The list of CPU for which the governor is to be set. """ - online_cpus = self.target.list_online_cpus() - for cpu in online_cpus: - self.set_governor(cpu, governor, kwargs) + for cpu in cpus: + self.set_governor(cpu, governor, **kwargs) def set_frequency_for_cpus(self, cpus, freq, exact=False): """ @@ -345,8 +344,7 @@ class CpufreqModule(Module): :param cpus: The list of CPU for which the frequency has to be set. """ - online_cpus = self.target.list_online_cpus() - for cpu in online_cpus: + for cpu in cpus: self.set_frequency(cpu, freq, exact) def set_all_frequencies(self, freq):