mirror of
				https://github.com/ARM-software/devlib.git
				synced 2025-11-03 23:41:21 +00:00 
			
		
		
		
	Merge pull request #62 from bjackman/check-governor-supported
cpufreq: Improve error when setting all CPUs to unsupported governor
This commit is contained in:
		@@ -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):
 | 
			
		||||
        """
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user