summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSiarhei Siamashka <siarhei.siamashka@gmail.com>2014-05-06 16:54:06 +0300
committerSiarhei Siamashka <siarhei.siamashka@gmail.com>2014-05-06 16:54:06 +0300
commit417e0f21dd098a049184abe2f0f32759c05331ed (patch)
treedc27cc96fc75931c0b45bfef61b138b52f3a039a
parentf77b43be239b4856ebf456ab842e96e89626ce1a (diff)
downloadcpuburn-arm-417e0f21dd098a049184abe2f0f32759c05331ed.tar.gz
cpuburn-arm-417e0f21dd098a049184abe2f0f32759c05331ed.tar.xz
Fix getting the list of available CPU frequencies on Allwinner A20
The sun7i kernel does not expose 'scaling_available_frequencies' in the cpufreq sysfs, so as a fallback solution get the list of available frequencies from 'stats/time_in_state'. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
-rwxr-xr-xcpufreq-ljt-stress-test6
1 files changed, 5 insertions, 1 deletions
diff --git a/cpufreq-ljt-stress-test b/cpufreq-ljt-stress-test
index c28627b..459f316 100755
--- a/cpufreq-ljt-stress-test
+++ b/cpufreq-ljt-stress-test
@@ -95,7 +95,11 @@ end
def get_freq_list(core)
freq_list = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/scaling_available_frequencies")
- return [] if not freq_list
+ if not freq_list then
+ freq_list = read_file("/sys/devices/system/cpu/cpu#{core}/cpufreq/stats/time_in_state")
+ return [] if not freq_list
+ return freq_list.split(/\s+/).each_slice(2).map {|x| x[0].to_i}
+ end
return freq_list.split(" ").map {|x| x.to_i}
end