diff --git a/devlib/module/cpufreq.py b/devlib/module/cpufreq.py index 31aa9db..3a3eec9 100644 --- a/devlib/module/cpufreq.py +++ b/devlib/module/cpufreq.py @@ -375,9 +375,18 @@ class CpufreqModule(Module): """ Set the specified governor for all the (online) CPUs """ - return self.target._execute_util( + try: + return self.target._execute_util( 'cpufreq_set_all_governors {}'.format(governor), as_root=True) + except TargetError as e: + if "echo: I/O error" in str(e): + cpus_unsupported = [c for c in self.target.list_online_cpus() + if governor not in self.list_governors(c)] + raise TargetError("Governor {} unsupported for CPUs {}".format( + governor, cpus_unsupported)) + else: + raise def get_all_governors(self): """