Skip to content

Commit 88f8c9e

Browse files
marcbonnicisetrofim
authored andcommitted
module/cpuidle: Add fallback for reading governor
As per #407 if the kernel is compiled with the ability to switch cpuidle governors via sysfs `current_governor_ro` is replaced with `current_governor` so check if the intial path exists before reading.
1 parent 0c434e8 commit 88f8c9e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

devlib/module/cpuidle.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,4 +173,7 @@ def get_driver(self):
173173
return self.target.read_value(self.target.path.join(self.root_path, 'current_driver'))
174174

175175
def get_governor(self):
176-
return self.target.read_value(self.target.path.join(self.root_path, 'current_governor_ro'))
176+
path = self.target.path.join(self.root_path, 'current_governor_ro')
177+
if not self.target.path.exist(path):
178+
path = self.target.path.join(self.root_path, 'current_governor')
179+
return self.target.read_value(path)

0 commit comments

Comments
 (0)